SOAP Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MR

    #1

    SOAP Help

    I am in dire need of help in trying to get the client code for a web
    service to work. i don't have a WSDL for the service so i created my own
    ASP.NET service to test with. i converted the DTD files that i was given to
    xsd files and used the xsd tool to create the classes. i used those classes
    to create the parameters for the web method defined as follows:

    [WebMethod]

    publicSchema.su bmitOrderBatchR esponse
    submitOrderBatc h(Schema.submit OrderBatch sob)

    {

    Schema.submitOr derBatchRespons e sbor = new
    Schema.submitOr derBatchRespons e();

    return sbor;


    }

    The proxy code is generated as:

    [System.Diagnost ics.DebuggerSte pThroughAttribu te()]

    [System.Componen tModel.Designer CategoryAttribu te("code")]

    [System.Web.Serv ices.WebService BindingAttribut e(Name="OrderOp erationsSoap",
    Namespace="http ://tempuri.org/")]

    public class OrderOperations :
    System.Web.Serv ices.Protocols. SoapHttpClientP rotocol {


    /// <remarks/>

    public OrderOperations () {

    this.Url = "http://localhost/Emulator/Emulator.asmx";

    }


    /// <remarks/>

    [System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://tempuri.org/submitOrderBatc h",
    RequestNamespac e="http://tempuri.org/",
    ResponseNamespa ce="http://tempuri.org/",
    Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
    ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]

    [return:
    System.Xml.Seri alization.XmlEl ementAttribute( Namespace="http ://tempuri.org/submitOrderBatc hResponse.xs")]

    public submitOrderBatc hResponse
    submitOrderBatc h([System.Xml.Seri alization.XmlEl ementAttribute( Namespace="http ://tempuri.org/submitOrderBatc h.xs")]
    submitOrderBatc h sob) {

    object[] results = this.Invoke("su bmitOrderBatch" , new object[] {sob});

    return ((submitOrderBa tchResponse)(re sults[0]));







    my client code works on the local host but when i go out to the real
    service it fails.

    i created the client in VS.NET 2003 and am referencing the web service that
    i created.

    I compared the logs of what i am sending to what i am supposed to send and
    the SOAP headers appear to be missing some info and some of the tags are
    wrong:



    This is what is being sent from the proxy

    <?xml version="1.0" encoding="utf-8"?>

    <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"

    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"

    xmlns:xsd="http ://www.w3.org/2001/XMLSchema">

    <soap:Body>

    <submitOrderBat ch xmlns="urn:Orde rOperations">

    <sob CustomerBatchID ="122" xmlns="http://tempuri.org/submitOrderBatc h.xs">

    <Customer CustomerID="109 7" OrderSource="NV L TEST CUSTOMER (CUSTOMER)" />
    <Orders> . . .



    This is what i should be sending in the body

    <ns1:submitOrde rBatch xmlns:ns1="urn: OrderOperations "

    SOAP-ENV:encodingSty le="http://xml.apache.org/xml-soap/literalxml">

    <orderBatchElem ent>



    1) why does the first line show up? (?xml version ... etc.)

    2) how can i get the correct SOAP headers?

    3) how do i get the correct tags? ns1:submitOrder Batch
    xmlns:ns1="urn: OrderOperations " instead of
    xmlns="http://tempuri.org/submitOrderBatc h.xs">

    thanks very much


  • [MSFT]

    #2
    RE: SOAP Help

    Hello,

    I think the problem should be that you generate the client proxy with your
    web service, not the actual one, Is your actual web service an ASP.NET web
    service? if so, maybe you can try wsdl.exe to generate the client code:


    http://msdn.microsoft.com/library/de...us/cptools/htm
    l/cpgrfwebservice sdescriptionlan guagetoolwsdlex e.asp

    Luke

    Comment

    • MR

      #3
      Re: SOAP Help

      that is problem. the actual site is not an ASP.NET service. it runs on an
      apache server and does not have a wsdl doc. so i cannot generate the client
      code. i cannot use disco.exe or wsdl.exe on that site.
      i think i need to know how to set the attributes so that the SOAP message is
      formatted correctly according to their requirements


      "[MSFT]" <lukezhan@onlin e.microsoft.com > wrote in message
      news:wLKewVspFH A.588@TK2MSFTNG XA01.phx.gbl...[color=blue]
      > Hello,
      >
      > I think the problem should be that you generate the client proxy with your
      > web service, not the actual one, Is your actual web service an ASP.NET web
      > service? if so, maybe you can try wsdl.exe to generate the client code:
      >
      >
      > http://msdn.microsoft.com/library/de...us/cptools/htm
      > l/cpgrfwebservice sdescriptionlan guagetoolwsdlex e.asp
      >
      > Luke[/color]


      Comment

      • [MSFT]

        #4
        Re: SOAP Help

        Can you contact the owner of the web service and have them provide a WSDL
        file? This should be the best solution for the issue.

        Luke

        Comment

        • MR

          #5
          Re: SOAP Help

          of course i've already tried that. it doesn't exist and thus is not
          available

          "[MSFT]" <lukezhan@onlin e.microsoft.com > wrote in message
          news:ZmvpZq4pFH A.2152@TK2MSFTN GXA01.phx.gbl.. .[color=blue]
          > Can you contact the owner of the web service and have them provide a WSDL
          > file? This should be the best solution for the issue.
          >
          > Luke[/color]


          Comment

          • [MSFT]

            #6
            Re: SOAP Help

            Hello,

            Maybe you can try Soap Toolkit 3.0, it will send the soap message like:

            SOAP-ENV:Envelope

            Here is the link for download it:

            http://www.microsoft.com/downloads/d...0DD-CEEC-4088-
            9753-86F052EC8450&di splaylang=en

            Luke

            Comment

            • MR

              #7
              Re: SOAP Help

              it seems that the toolkit requires a wsdl document. i don't have one and
              can't get one. is there another way?

              "[MSFT]" <lukezhan@onlin e.microsoft.com > wrote in message
              news:VpnA1lFqFH A.2152@TK2MSFTN GXA01.phx.gbl.. .[color=blue]
              > Hello,
              >
              > Maybe you can try Soap Toolkit 3.0, it will send the soap message like:
              >
              > SOAP-ENV:Envelope
              >
              > Here is the link for download it:
              >
              > http://www.microsoft.com/downloads/d...0DD-CEEC-4088-
              > 9753-86F052EC8450&di splaylang=en
              >
              > Luke[/color]


              Comment

              • [MSFT]

                #8
                Re: SOAP Help

                You may try consume the remote web service with local WSDL file. Anyway, I
                cannot guarantee this will be successful.

                Luke

                Comment

                Working...