Loading ...
Sorry, an error occurred while loading the content.

Re: [soapbuilders] .NET Server/Java client, method params ignored?

Expand Messages
  • Sam Ruby
    To ensure interoperability, make very sure that you get the correct parameter names. Here is a successful example with various data types:
    Message 1 of 5 , Apr 1 7:37 AM
    • 0 Attachment
      To ensure interoperability, make very sure that you get the correct
      parameter names.

      Here is a successful example with various data types:

      http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-soap/java/samples/interop/EchoTestClient.java

      Here is the same example using JAX RPC and Apache Axis. You might find it
      simpler and less error prone:

      http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-axis/java/samples/echo/TestClient.java

      - Sam Ruby
    • Chester Chen
      Hi, Sam This is great. Any samples for using .net or VB as Client to test Apache SOAP 2.2 or AXIS server ? Chester ...
      Message 2 of 5 , Apr 1 10:23 AM
      • 0 Attachment
        Hi, Sam
        This is great. Any samples for using .net or VB as
        Client to test Apache SOAP 2.2 or AXIS server ?

        Chester


        --- Sam Ruby <rubys@...> wrote:
        > To ensure interoperability, make very sure that you
        > get the correct
        > parameter names.
        >
        > Here is a successful example with various data
        > types:
        >
        >
        >
        http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-soap/java/samples/interop/EchoTestClient.java
        >
        > Here is the same example using JAX RPC and Apache
        > Axis. You might find it
        > simpler and less error prone:
        >
        >
        >
        http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-axis/java/samples/echo/TestClient.java
        >
        > - Sam Ruby
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Yahoo! Greetings - send holiday greetings for Easter, Passover
        http://greetings.yahoo.com/
      • derrick_butler
        Thanks for the links, I went thru the sample code, and did have my param names mismatched in the example I gave. I am still getting my param values dropped
        Message 3 of 5 , Apr 9 2:16 PM
        • 0 Attachment
          Thanks for the links, I went thru the sample code, and did have my
          param names mismatched in the example I gave. I am still getting my
          param values 'dropped' before they get to my C# .NET beta 2 web
          service though, any other ideas?

          Again, here's what .NET says it expects for my C# method...

          POST /DTS/Service1.asmx HTTP/1.1
          Host: localhost
          Content-Type: text/xml; charset=utf-8
          Content-Length: length
          SOAPAction: "http://tempuri.org/HelloWorld2"

          <?xml version="1.0" encoding="utf-8"?>
          <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
          <soap:Body>
          <HelloWorld2 xmlns="http://tempuri.org/">
          <NAME>string</NAME>
          </HelloWorld2>
          </soap:Body>
          </soap:Envelope>



          Here is what is being sent from my java client...


          POST /DTS/service1.asmx HTTP/1.0
          Host: localhost
          Content-Type: text/xml; charset=utf-8
          Content-Length: 466
          SOAPAction: "http://tempuri.org/HelloWorld2"

          <?xml version='1.0' encoding='UTF-8'?>
          <SOAP-ENV:Envelope xmlns:SOAP-
          ENV="http://schemas.xmlsoap.org/soap/envelope/"
          xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/1999/XMLSchema">
          <SOAP-ENV:Body>
          <ns1:HelloWorld2 xmlns:ns1="http://tempuri.org/HelloWorld2" SOAP-
          ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
          <NAME xsi:type="xsd:string">Fred</NAME>
          </ns1:HelloWorld2>
          </SOAP-ENV:Body>
          </SOAP-ENV:Envelope>


          And here is the java client code...



          URL url = new URL ("http://localhost:8080/DTS/service1.asmx");

          SOAPMappingRegistry smr = new SOAPMappingRegistry ();
          smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName
          ("http://tempuri.org/", "HelloWorld2Result"), null, null, stringDser);

          // create the transport and set parameters
          SOAPHTTPConnection st = new SOAPHTTPConnection();

          // build the call.
          Call call = new Call ();
          call.setSOAPTransport(st);
          call.setSOAPMappingRegistry (smr);
          call.setTargetObjectURI ("http://tempuri.org/HelloWorld2");
          call.setMethodName("HelloWorld2");
          call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

          Vector params = new Vector();
          params.addElement(new Parameter("NAME", String.class, "Fred",
          null));
          call.setParams(params);

          Response resp = null;
          try
          {
          resp = call.invoke (url, "http://tempuri.org/HelloWorld2");
          }
          catch (SOAPException e)
          {
          System.err.println("Caught SOAPException (" + e.getFaultCode ()
          + "): " + e.getMessage ());
          return;
          }

          Thanks again in advance, looks like an encoding style interop problem?

          Derrick


          --- In soapbuilders@y..., "Sam Ruby" <rubys@u...> wrote:
          > To ensure interoperability, make very sure that you get the correct
          > parameter names.
          >
          > Here is a successful example with various data types:
          >
          > http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-
          soap/java/samples/interop/EchoTestClient.java
          >
          > Here is the same example using JAX RPC and Apache Axis. You might
          find it
          > simpler and less error prone:
          >
          > http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-
          axis/java/samples/echo/TestClient.java
          >
          > - Sam Ruby
        • Simon Fell
          You re sending a section 5 encoded message to an endpoint expecting a doc/literal request, You ll need to either change the .NET end to use section 5 encoding,
          Message 4 of 5 , Apr 9 6:27 PM
          • 0 Attachment
            You're sending a section 5 encoded message to an endpoint expecting a
            doc/literal request, You'll need to either change the .NET end to use
            section 5 encoding, or change your Java code to send a doc/literal
            request. [I really wish ASP.NET faulted when it saw an unexpected
            encoding, this has to be the most common interop issue currently]

            Cheers
            Simon
            www.pocketsoap.com

            On Tue, 09 Apr 2002 21:16:22 -0000, in soap you wrote:

            >Thanks for the links, I went thru the sample code, and did have my
            >param names mismatched in the example I gave. I am still getting my
            >param values 'dropped' before they get to my C# .NET beta 2 web
            >service though, any other ideas?
            >
            >Again, here's what .NET says it expects for my C# method...
            >
            >POST /DTS/Service1.asmx HTTP/1.1
            >Host: localhost
            >Content-Type: text/xml; charset=utf-8
            >Content-Length: length
            >SOAPAction: "http://tempuri.org/HelloWorld2"
            >
            ><?xml version="1.0" encoding="utf-8"?>
            ><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            >xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            >xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
            > <soap:Body>
            > <HelloWorld2 xmlns="http://tempuri.org/">
            > <NAME>string</NAME>
            > </HelloWorld2>
            > </soap:Body>
            ></soap:Envelope>
            >
            >
            >
            >Here is what is being sent from my java client...
            >
            >
            >POST /DTS/service1.asmx HTTP/1.0
            >Host: localhost
            >Content-Type: text/xml; charset=utf-8
            >Content-Length: 466
            >SOAPAction: "http://tempuri.org/HelloWorld2"
            >
            ><?xml version='1.0' encoding='UTF-8'?>
            ><SOAP-ENV:Envelope xmlns:SOAP-
            >ENV="http://schemas.xmlsoap.org/soap/envelope/"
            >xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
            >xmlns:xsd="http://www.w3.org/1999/XMLSchema">
            ><SOAP-ENV:Body>
            ><ns1:HelloWorld2 xmlns:ns1="http://tempuri.org/HelloWorld2" SOAP-
            >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            ><NAME xsi:type="xsd:string">Fred</NAME>
            ></ns1:HelloWorld2>
            ></SOAP-ENV:Body>
            ></SOAP-ENV:Envelope>
            >
            >
            >And here is the java client code...
            >
            >
            >
            > URL url = new URL ("http://localhost:8080/DTS/service1.asmx");
            >
            > SOAPMappingRegistry smr = new SOAPMappingRegistry ();
            > smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName
            >("http://tempuri.org/", "HelloWorld2Result"), null, null, stringDser);
            >
            > // create the transport and set parameters
            > SOAPHTTPConnection st = new SOAPHTTPConnection();
            >
            > // build the call.
            > Call call = new Call ();
            > call.setSOAPTransport(st);
            > call.setSOAPMappingRegistry (smr);
            > call.setTargetObjectURI ("http://tempuri.org/HelloWorld2");
            > call.setMethodName("HelloWorld2");
            > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
            >
            > Vector params = new Vector();
            > params.addElement(new Parameter("NAME", String.class, "Fred",
            >null));
            > call.setParams(params);
            >
            > Response resp = null;
            > try
            > {
            > resp = call.invoke (url, "http://tempuri.org/HelloWorld2");
            > }
            > catch (SOAPException e)
            > {
            > System.err.println("Caught SOAPException (" + e.getFaultCode ()
            >+ "): " + e.getMessage ());
            > return;
            > }
            >
            >Thanks again in advance, looks like an encoding style interop problem?
            >
            >Derrick
            >
            >
            >--- In soapbuilders@y..., "Sam Ruby" <rubys@u...> wrote:
            >> To ensure interoperability, make very sure that you get the correct
            >> parameter names.
            >>
            >> Here is a successful example with various data types:
            >>
            >> http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-
            >soap/java/samples/interop/EchoTestClient.java
            >>
            >> Here is the same example using JAX RPC and Apache Axis. You might
            >find it
            >> simpler and less error prone:
            >>
            >> http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-
            >axis/java/samples/echo/TestClient.java
            >>
            >> - Sam Ruby
            >
            >
            >
            >-----------------------------------------------------------------
            >This group is a forum for builders of SOAP implementations to discuss implementation and interoperability issues. Please stay on-topic.
            >
            >To unsubscribe from this group, send an email to:
            >soapbuilders-unsubscribe@yahoogroups.com
            >
            >
            >
            >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.