views:

242

answers:

1

I am in the process of creating a system that sends specific user data to a web service. Basically, the user enters his name, telephone number and reference number. He then selects whether he is called immediately or at a specific time. This information that is sent is then added to a dialler system and the calls back are generated from.

I have been provided with a somewhat documentation of the website service. Unfortunately, how to working with it still escapes me. I have designed the form and added the required validation. The documentation adds this:

The Stored procedure will accept the field names and values

  • a) The process will execute on demand.
  • b) Flag rejected records (no phone number specified for Contact Numbers OR Contact Number has an invalid length NOT between 10 and 15).
  • c) Insert valid phone numbers from parameter collection. Amcat will add a leading 0 (zero) to the phone number should one not exist
  • d) Insert the phone numbers into the ContactPhoneNumbers table.
  • e) Insert the data into the ContactInfo & ContactDetails tables with the parameters supplied. A default value will be inserted if no parameter value is specified.
  • f) If a field name specified by the XML does not exist then a warning will be returned by the web service as a string but the contact number will still be entered and sent to dial.
  • g) Return the required details to carry out an instant dial.

And this is the kind of of XML format that is expected... My apologies if this is pretty long:

<?xml version="1.0" encoding="utf-8" ?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/"
  xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"&gt;
      <s:element name="Call">
        <s:element name="CallResponse">
          <s:complexType>
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="CallResult"
                type="s:string" />
            </s:sequence>
          </s:complexType>
        </s:element>
        <s:element name="string" nillable="true" type="s:string" />
    </s:schema>
  </wsdl:types>
  <wsdl:message name="CallSoapIn">
    <wsdl:message name="CallSoapOut">
      <wsdl:part name="parameters" element="tns:CallResponse" />
    </wsdl:message>
    <wsdl:message name="CallHttpGetIn">
      <wsdl:part name="xmlString" type="s:string" />
    </wsdl:message>
    <wsdl:message name="CallHttpGetOut">
      <wsdl:part name="Body" element="tns:string" />
    </wsdl:message>
    <wsdl:message name="CallHttpPostIn">
      <wsdl:part name="xmlString" type="s:string" />
    </wsdl:message>
    <wsdl:message name="CallHttpPostOut">
      <wsdl:part name="Body" element="tns:string" />
    </wsdl:message>
    <wsdl:portType name="CallRequestSoap">
      <wsdl:operation name="Call">
        <wsdl:input message="tns:CallSoapIn" />
        <wsdl:output message="tns:CallSoapOut" />
      </wsdl:operation>
    </wsdl:portType>
    <wsdl:portType name="CallRequestHttpGet">
      <wsdl:operation name="Call">
    </wsdl:portType>
    <wsdl:portType name="CallRequestHttpPost">
      <wsdl:operation name="Call">
        <wsdl:input message="tns:CallHttpPostIn" />
        <wsdl:output message="tns:CallHttpPostOut" />
      </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="CallRequestSoap" type="tns:CallRequestSoap">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
      <wsdl:operation name="Call">
        <soap:operation soapAction="http://tempuri.org/Call" style="document" />
        <wsdl:input>
          <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
          <soap:body use="literal" />
        </wsdl:output>
      </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="CallRequestHttpGet" type="tns:CallRequestHttpGet">
      <http:binding verb="GET" />
      <wsdl:operation name="Call">
        <http:operation location="/Call" />
        <wsdl:input>
          <http:urlEncoded />
        </wsdl:input>
        <wsdl:output>
          <mime:mimeXml part="Body" />
        </wsdl:output>
      </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="CallRequestHttpPost" type="tns:CallRequestHttpPost">
      <http:binding verb="POST" />
      <wsdl:operation name="Call">
        <http:operation location="/Call" />
        <wsdl:input>
          <mime:content type="application/x-www-form-urlencoded" />
        </wsdl:input>
        <wsdl:output>
          <mime:mimeXml part="Body" />
        </wsdl:output>
      </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="CallRequest">
      <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
      <wsdl:port name="CallRequestSoap" binding="tns:CallRequestSoap">
        <soap:address location="http://localhost/ClickToCall/CallRequest.asmx" />
      </wsdl:port>
      <wsdl:port name="CallRequestHttpGet" binding="tns:CallRequestHttpGet">
        <http:address location="http://localhost/ClickToCall/CallRequest.asmx" />
      </wsdl:port>
      <wsdl:port name="CallRequestHttpPost" binding="tns:CallRequestHttpPost">
        <http:address location="http://localhost/ClickToCall/CallRequest.asmx" />
      </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

I am so totally lost here, how do I get something like this done? I know SOAP is involved in something like this... but I have no idea what to do... So any assistance would be appreciate it.

Thanks

Sam

+1  A: 

You are trying to talk to a SOAP web service. Doing this by hand is very painful. Have a look at this as one example of a package for the purpose.

bmargulies