users@jax-rpc.java.net

Re: SOAP invocation

From: Guadalupe Ortiz <gobellot_at_hotmail.com>
Date: Sat, 26 Feb 2005 14:09:11 +0100

Thanks a lot for your help!!! It is working fine now,
Kind regards,
Guadalupe
----- Original Message -----
From: "Anne Thomas Manes" <atmanes_at_gmail.com>
To: <users_at_jax-rpc.dev.java.net>
Sent: Saturday, February 26, 2005 2:58 AM
Subject: Re: SOAP invocation


> Please disregard my last message. You had the correct namespace.
>
> In fact (according to the SOAP message you posted), you are no longer
> getting the unrecognized operation error. Now you are getting an
> "unexpected encoding style" exception. You need to set the encoding
> style to "http://schemas.xmlsoap.org/soap/encoding/".
>
> - Anne
>
>
> On Fri, 25 Feb 2005 13:15:34 +0100, Guadalupe Ortiz
> <gobellot_at_hotmail.com> wrote:
> >
> > I still receive the same error message: [..] unrecognized operation:
> > {urn:foo}convert.
> > I post the sended and received soap message which are shown in the
output
> > stream. Maybe you can see there where my error is.
> >
> >
> > ----- Original Message -----
> > From: "Anne Thomas Manes" <atmanes_at_gmail.com>
> > To: <users_at_jax-rpc.dev.java.net>
> >
> > Sent: Friday, February 25, 2005 4:26 AM
> > Subject: Re: SOAP invocation
> >
> >
> > > The problem is that you're setting the wrong namespace for your
> > > message. According to the WSDL document, the namespace for the
> > > "convert" operation should be "urn:foo":
> > >
> > > > - <operation name="convert">
> > > > - <input>
> > > > <soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > > use="encoded" namespace="urn:Foo" />
> > > > </input>
> > >
> > > But in your application, you're setting the namespace to
> > > "MyCurrencyConverterAspectsService".
> > >
> > > Change this:
> > >
> > > SOAPFactory soapFactory =
> > > SOAPFactory.newInstance();
> > > Name bodyName = envelope.createName("convert", "foo",
> > > "MyCurrencyConverterAspectsService");
> > > SOAPBodyElement convert = body.addBodyElement(bodyName);
> > >
> > > to this:
> > >
> > > SOAPFactory soapFactory =
> > > SOAPFactory.newInstance();
> > > Name bodyName = envelope.createName("convert", "foo",
> > > "urn:foo");
> > > SOAPBodyElement convert = body.addBodyElement(bodyName);
> > >
> > > and it should work.
> > >
> > >
> > > On Thu, 24 Feb 2005 09:53:58 +0100, Guadalupe Ortiz
> > > <gobellot_at_hotmail.com> wrote:
> > > > Sorry; I was just posting the address for indicating it was the same
as
> > in
> > > > the URL element. Here goes my WSDL:
> > > >
> > > > <?xml version="1.0" encoding="UTF-8" ?>
> > > > - <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
> > xmlns:tns="urn:Foo"
> > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > > name="MyCurrencyConverterAspectsService" targetNamespace="urn:Foo">
> > > > <types />
> > > > - <message name="CurrencyConverterAspectsIF_convert">
> > > > <part name="String_1" type="xsd:string" />
> > > > <part name="String_2" type="xsd:string" />
> > > > <part name="String_3" type="xsd:string" />
> > > > </message>
> > > > - <message name="CurrencyConverterAspectsIF_convertResponse">
> > > > <part name="result" type="xsd:string" />
> > > > </message>
> > > > - <portType name="CurrencyConverterAspectsIF">
> > > > - <operation name="convert" parameterOrder="String_1 String_2
String_3">
> > > > <input message="tns:CurrencyConverterAspectsIF_convert" />
> > > > <output message="tns:CurrencyConverterAspectsIF_convertResponse"
/>
> > > > </operation>
> > > > </portType>
> > > > - <binding name="CurrencyConverterAspectsIFBinding"
> > > > type="tns:CurrencyConverterAspectsIF">
> > > > - <operation name="convert">
> > > > - <input>
> > > > <soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > > use="encoded" namespace="urn:Foo" />
> > > > </input>
> > > > - <output>
> > > > <soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > > use="encoded" namespace="urn:Foo" />
> > > > </output>
> > > > <soap:operation soapAction="" />
> > > > </operation>
> > > > <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> > style="rpc"
> > > > />
> > > > </binding>
> > > > - <service name="MyCurrencyConverterAspectsService">
> > > > - <port name="CurrencyConverterAspectsIFPort"
> > > > binding="tns:CurrencyConverterAspectsIFBinding">
> > > > <soap:address xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > >
> >
location="http://localhost:8080/currencyConverterAspects-jaxrpc/currencyConv
> > > > erterAspects" />
> > > > </port>
> > > > </service>
> > > > </definitions>
> > > >
> > > > Thanks for your time,
> > > > Guadalupe
> > > >
> > > > ----- Original Message -----
> > > > From: "Anne Thomas Manes" <atmanes_at_gmail.com>
> > > > To: <users_at_jax-rpc.dev.java.net>
> > > > Sent: Wednesday, February 23, 2005 9:42 PM
> > > > Subject: Re: SOAP invocation
> > > >
> > > > > Please post the WSDL file. (we can't access it from your
localhost(
> > > > >
> > > > > The message indicates that it doesn't recognize the operation
name.
> > > > >
> > > > > Anne
> > > > >
> > > > >
> > > > > On Wed, 23 Feb 2005 10:28:46 +0100, Guadalupe Ortiz
> > > > > <gobellot_at_hotmail.com> wrote:
> > > > > >
> > > > > > Related to my previous question. I am trying to build a SOAP
message
> > > > > > (without using JAXRPC) to invoke a JAXRPC service.
> > > > > > The service is at
> > > > > >
> > > >
> >
http://localhost:8080/currencyConverterAspects-jaxrpc/currencyConverterAspects?WSDL
> > > > > >
> > > > > > And it offers one operation, convert, with three string
parametres.
> > The
> > > > code
> > > > > > I execute is:
> > > > > > SOAPConnectionFactory soapConnectionFactory =
> > > > > > SOAPConnectionFactory.newInstance();
> > > > > > SOAPConnection connection =
> > > > > > soapConnectionFactory.createConnection();
> > > > > > MessageFactory messageFactory =
> > > > > > MessageFactory.newInstance();
> > > > > >
> > > > > > SOAPMessage message =
> > > > > > messageFactory.createMessage();
> > > > > >
> > > > > > SOAPPart part = message.getSOAPPart();
> > > > > > SOAPEnvelope envelope = part.getEnvelope();
> > > > > > SOAPBody body = envelope.getBody();
> > > > > >
> > > > > > SOAPFactory soapFactory =
> > > > > > SOAPFactory.newInstance();
> > > > > > Name bodyName = envelope.createName("convert", "foo",
> > > > > > "MyCurrencyConverterAspectsService");
> > > > > > SOAPBodyElement convert =
body.addBodyElement(bodyName);
> > > > > >
> > > > > >
> > > > > > Name amountName = envelope.createName("String_1");
> > > > > > SOAPElement amount =
> > convert.addChildElement(amountName);
> > > > > > amount.addTextNode("10");
> > > > > > Name fromCurrencyName =
envelope.createName("String_2");
> > > > > > SOAPElement fromCurrency =
> > > > > > convert.addChildElement(fromCurrencyName);
> > > > > > fromCurrency.addTextNode("USD");
> > > > > > Name toCurrencyName =
envelope.createName("String_3");
> > > > > > SOAPElement toCurrency=
> > > > convert.addChildElement(toCurrencyName);
> > > > > > toCurrency.addTextNode("EUR");
> > > > > >
> > > > > > message.saveChanges();
> > > > > >
> > > > > > System.out.println("\n--- Request Message ---\n");
> > > > > > message.writeTo(System.out);
> > > > > >
> > > > > > URL endpoint = new
> > > > > >
> > > >
> >
URL("http://localhost:8080/currencyConverterAspects-jaxrpc/currencyConverter
> > > > Aspects");
> > > > > >
> > > > > > SOAPMessage reply =
> > > > > > connection.call(message, endpoint);
> > > > > >
> > > > > > System.out.println("\n\nReceived reply from: " +
> > > > > > endpoint);
> > > > > > System.out.println("\n---- Reply Message ----\n");
> > > > > >
> > > > > > reply.writeTo(System.out);
> > > > > >
> > > > > > The fault code I receive in a SOAP faultString is:
> > > > > > [...]<faultString>JAXRPC.TIE01: caugh exception while
handling
> > > > request:
> > > > > > unrecognized operation
> > > > > > {MyCurrencyConverterAspectsService}convert</faultString>
> > > > > >
> > > > > > Any clue about what I am doing wrong? Thanks in advance,
> > > > > > Guadalupe
> > > > > >
> > > > >
> > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> > > > > For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> > > > >
> > > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> > > > For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> > > For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>