You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "John G. Norman" <jo...@7fff.com> on 2007/06/08 20:22:21 UTC

Does Axis2 1.2 REST work with POJO service?

Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
POJO service?

The short version of my question is that I'm making a GET request like this:

http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John

But am getting an exception regarding a namespace mismatch

Here's what I did to samples/pojo:

1. Have the default constructor to the sample/pojo AddressBookService
add a couple of Entry. E.g.,

  public AddressBookService() {
    super();
    Entry e1 = new Entry();
    e1.setName("John");
    e1.setStreet("1 Broadway");
    e1.setCity("Cambridge");
    e1.setState("MA");
    e1.setPostalCode("02142");
    Entry e2 = new Entry();
    e2.setName("George");
    e2.setStreet("1600 Penn");
    e2.setCity("Washington");
    e2.setState("DC");
    e2.setPostalCode("01111");
    entries.put(e1.getName(), e1);
    entries.put(e2.getName(), e2);
  }

2. Build and deploy.

3. Try and access the service as follows:

http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John

4. Get exception like this:

Jun 8, 2007 1:56:30 PM
org.apache.axis2.rpc.receivers.RPCMessageReceiver invokeBusinessLogic
SEVERE: Exception occurred while trying to invoke service method findEntry
org.apache.axis2.AxisFault: namespace mismatch require
http://service.addressbook.sample/xsd found none
    at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
    at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)

5. I haven't added a JIRA -- seems like this one deserves a sanity
check. Anyone?

I found this in my own code where a service which worked via the 1.1.1
Axis2RestServlet worked; but is now seemingly broken in the same way
as the above.

6. As an aside, the documentation here:

    http://ws.apache.org/axis2/1_2/rest-ws.html

is quite thin. The very last section shows a regular GET accessing
version information via
http://127.0.0.1:8080/axis2/services/Version/getVersion -- that's
perfectly nice, but showing a few more examples, e.g., accessing a
service with parameters -- would be more realistic. To be sure, one
might write a Java REST client, but I would hazard a guess that many
users are clients are in scripting languages and they just want to hit
the URL and get the XML representation back.

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Does Axis2 1.2 REST work with POJO service?

Posted by Ognjen Blagojevic <og...@etf.bg.ac.yu>.
Hello John,

John G. Norman wrote:
> 4. Get exception like this:
...
> SEVERE: Exception occurred while trying to invoke service method findEntry
> org.apache.axis2.AxisFault: namespace mismatch require
> http://service.addressbook.sample/xsd found none

Maybe you could try to use TCPMon to capture request and response, and 
then to send it to the list.

I tried POJO WS with POX and URL parameters without any problems. I 
don't know what is the problem with namespace mismatch, but if we have 
request/response, maybe it will be more clear.

Regards,
Ognjen

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Does Axis2 1.2 REST work with POJO service?

Posted by "John G. Norman" <jo...@7fff.com>.
I had to abandon researching this for a variety of reasons.

But now I've done enough to add a JIRA with my sample code.

How about an automated test that verifies that some pojo service can
actually do some trivial REST? :-)

REST support for pojo services is definitely broken for 1.2. The exact
same code works on 1.1.1 but not on 1.2.

My example code is samples/pojo. I simply added a constructor to
AddressBookService to seed the list of address book entries with one
entry. Nothing more than:

  public AddressBookService() {
    Entry entry = new Entry();
    entry.setName("John");
    entry.setStreet("1 Broadway");
    entry.setCity("Cambridge");
    entry.setState("MA");
    entry.setPostalCode("02142");
    addEntry(entry);
  }

For 1.1.1, this:

http://localhost:8080/axis2/rest/AddressBookService/findEntry?param0=John

works, and returns, e.g.,

<ns:findEntryResponse
xmlns:ns="http://service.addressbook.sample/xsd"><ns:return><city
xmlns="http://entry.addressbook.sample/xsd">Cambridge</city><name
xmlns="http://entry.addressbook.sample/xsd">John</name><postalCode
xmlns="http://entry.addressbook.sample/xsd">02142</postalCode><state
xmlns="http://entry.addressbook.sample/xsd">MA</state><street
xmlns="http://entry.addressbook.sample/xsd">1
Broadway</street></ns:return></ns:findEntryResponse>

Whereas for 1.2, the same code returns (going for the URL
http://localhost:8080/axis2/services/AddressBookService/findEntry?param0=John
since under 1.2 the /services endpoint now also handles the REST):

throws . . .

Jul 6, 2007 11:10:26 AM
org.apache.axis2.rpc.receivers.RPCMessageReceiver invokeBusinessLogic
SEVERE: Exception occurred while trying to invoke service method findEntry
org.apache.axis2.AxisFault: namespace mismatch require
http://service.addressbook.sample/xsd found none
	at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
	at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
	at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:122)
	at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:116)
	at org.apache.axis2.transport.http.AxisServlet$ProcessRESTRequest.processURLRequest(AxisServlet.java:776)
	at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:238)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

Below is the generated WDSL for each version. Oh, tip for developers:
Throw in some newlines into your generated WSDL so that it's easier to
do a diff. Sheesh.

1.1.1:

<wsdl:definitions xmlns:axis2="http://service.addressbook.sample"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:ns0="http://service.addressbook.sample/xsd"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:ns1="http://entry.addressbook.sample/xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://service.addressbook.sample"><wsdl:documentation>
        POJO: AddressBook Service
    </wsdl:documentation><wsdl:types><xs:schema
xmlns:ns="http://service.addressbook.sample/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://service.addressbook.sample/xsd">
<xs:element name="findEntry">
<xs:complexType>
<xs:sequence>
<xs:element name="param0" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="findEntryResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" nillable="true" type="ns1:Entry" />
</xs:sequence>
</xs:complexType>

</xs:element>
<xs:element name="addEntry">
<xs:complexType>
<xs:sequence>
<xs:element name="param0" nillable="true" type="ns1:Entry" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema><xs:schema
xmlns:ax21="http://entry.addressbook.sample/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://entry.addressbook.sample/xsd">
<xs:element name="Entry" type="ax21:Entry" />
<xs:complexType name="Entry">
<xs:sequence>
<xs:element name="city" nillable="true" type="xs:string" />
<xs:element name="name" nillable="true" type="xs:string" />
<xs:element name="postalCode" nillable="true" type="xs:string" />
<xs:element name="state" nillable="true" type="xs:string" />
<xs:element name="street" nillable="true" type="xs:string" />

</xs:sequence>
</xs:complexType>
</xs:schema></wsdl:types><wsdl:message
name="addEntryMessage"><wsdl:part name="part1" element="ns0:addEntry"
/></wsdl:message><wsdl:message name="findEntryMessage"><wsdl:part
name="part1" element="ns0:findEntry" /></wsdl:message><wsdl:message
name="findEntryResponse"><wsdl:part name="part1"
element="ns0:findEntryResponse" /></wsdl:message><wsdl:portType
name="AddressBookServicePortType"><wsdl:operation
name="addEntry"><wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:addEntryMessage" wsaw:Action="urn:addEntry"
/></wsdl:operation><wsdl:operation name="findEntry"><wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:findEntryMessage" wsaw:Action="urn:findEntry"
/><wsdl:output message="axis2:findEntryResponse"
/></wsdl:operation></wsdl:portType><wsdl:binding
name="AddressBookServiceSOAP11Binding"
type="axis2:AddressBookServicePortType"><soap:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl:operation name="addEntry"><soap:operation
soapAction="urn:addEntry" style="document" /><wsdl:input><soap:body
use="literal" /></wsdl:input></wsdl:operation><wsdl:operation
name="findEntry"><soap:operation soapAction="urn:findEntry"
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="AddressBookServiceSOAP12Binding"
type="axis2:AddressBookServicePortType"><soap12:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl:operation name="addEntry"><soap12:operation
soapAction="urn:addEntry" style="document" /><wsdl:input><soap12:body
use="literal" /></wsdl:input></wsdl:operation><wsdl:operation
name="findEntry"><soap12:operation soapAction="urn:findEntry"
style="document" /><wsdl:input><soap12:body use="literal"
/></wsdl:input><wsdl:output><soap12:body use="literal"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
name="AddressBookServiceHttpBinding"
type="axis2:AddressBookServicePortType"><http:binding verb="POST"
/><wsdl:operation name="addEntry"><http:operation location="addEntry"
/><wsdl:input><mime:content type="text/xml"
/></wsdl:input></wsdl:operation><wsdl:operation
name="findEntry"><http:operation location="findEntry"
/><wsdl:input><mime:content type="text/xml"
/></wsdl:input><wsdl:output><mime:content type="text/xml"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
name="AddressBookService"><wsdl:port
name="AddressBookServiceSOAP11port_http"
binding="axis2:AddressBookServiceSOAP11Binding"><soap:address
location="http://localhost:8080/axis2/services/AddressBookService"
/></wsdl:port><wsdl:port name="AddressBookServiceSOAP12port_http"
binding="axis2:AddressBookServiceSOAP12Binding"><soap12:address
location="http://localhost:8080/axis2/services/AddressBookService"
/></wsdl:port><wsdl:port name="AddressBookServiceHttpport1"
binding="axis2:AddressBookServiceHttpBinding"><http:address
location="http://localhost:8080/axis2/rest/AddressBookService"
/></wsdl:port></wsdl:service></wsdl:definitions>

1.2:

<wsdl:definitions xmlns:axis2="http://service.addressbook.sample"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:ns0="http://service.addressbook.sample/xsd"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:ns1="http://entry.addressbook.sample/xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://service.addressbook.sample"><wsdl:documentation>AddressBookService</wsdl:documentation><wsdl:types><xs:schema
xmlns:ns="http://service.addressbook.sample/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://service.addressbook.sample/xsd">
<xs:element name="findEntry">
<xs:complexType>
<xs:sequence>
<xs:element name="param0" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="findEntryResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" nillable="true" type="ns1:Entry" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addEntry">

<xs:complexType>
<xs:sequence>
<xs:element name="param0" nillable="true" type="ns1:Entry" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema><xs:schema
xmlns:ax21="http://entry.addressbook.sample/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://entry.addressbook.sample/xsd">
<xs:element name="Entry" type="ax21:Entry" />
<xs:complexType name="Entry">
<xs:sequence>
<xs:element name="city" nillable="true" type="xs:string" />
<xs:element name="name" nillable="true" type="xs:string" />
<xs:element name="postalCode" nillable="true" type="xs:string" />
<xs:element name="state" nillable="true" type="xs:string" />
<xs:element name="street" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>

</xs:schema></wsdl:types><wsdl:message
name="addEntryMessage"><wsdl:part name="part1" element="ns0:addEntry"
/></wsdl:message><wsdl:message name="findEntryMessage"><wsdl:part
name="part1" element="ns0:findEntry" /></wsdl:message><wsdl:message
name="findEntryResponse"><wsdl:part name="part1"
element="ns0:findEntryResponse" /></wsdl:message><wsdl:portType
name="AddressBookServicePortType"><wsdl:operation
name="addEntry"><wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:addEntryMessage" wsaw:Action="urn:addEntry"
/></wsdl:operation><wsdl:operation name="findEntry"><wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:findEntryMessage" wsaw:Action="urn:findEntry"
/><wsdl:output message="axis2:findEntryResponse"
/></wsdl:operation></wsdl:portType><wsdl:binding
name="AddressBookServiceSOAP11Binding"
type="axis2:AddressBookServicePortType"><soap:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl:operation name="addEntry"><soap:operation
soapAction="urn:addEntry" style="document" /><wsdl:input><soap:body
use="literal" /></wsdl:input></wsdl:operation><wsdl:operation
name="findEntry"><soap:operation soapAction="urn:findEntry"
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="AddressBookServiceSOAP12Binding"
type="axis2:AddressBookServicePortType"><soap12:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl:operation name="addEntry"><soap12:operation
soapAction="urn:addEntry" style="document" /><wsdl:input><soap12:body
use="literal" /></wsdl:input></wsdl:operation><wsdl:operation
name="findEntry"><soap12:operation soapAction="urn:findEntry"
style="document" /><wsdl:input><soap12:body use="literal"
/></wsdl:input><wsdl:output><soap12:body use="literal"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
name="AddressBookServiceHttpBinding"
type="axis2:AddressBookServicePortType"><http:binding verb="POST"
/><wsdl:operation name="addEntry"><http:operation location="addEntry"
/><wsdl:input><mime:content type="text/xml"
/></wsdl:input></wsdl:operation><wsdl:operation
name="findEntry"><http:operation location="findEntry"
/><wsdl:input><mime:content type="text/xml"
/></wsdl:input><wsdl:output><mime:content type="text/xml"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
name="AddressBookService"><wsdl:port
name="AddressBookServiceSOAP11port_http"
binding="axis2:AddressBookServiceSOAP11Binding"><soap:address
location="http://192.168.48.1:8080/axis2/services/AddressBookService"
/></wsdl:port><wsdl:port name="AddressBookServiceSOAP12port_http"
binding="axis2:AddressBookServiceSOAP12Binding"><soap12:address
location="http://192.168.48.1:8080/axis2/services/AddressBookService"
/></wsdl:port><wsdl:port name="AddressBookServiceHttpport"
binding="axis2:AddressBookServiceHttpBinding"><http:address
location="http://192.168.48.1:8080/axis2/services/AddressBookService"
/></wsdl:port></wsdl:service></wsdl:definitions>

On 6/15/07, John G. Norman <jo...@7fff.com> wrote:
> Keith,
>
> That's what's apparently broken.
>
> John
>
> On 6/11/07, keith chapman <ke...@gmail.com> wrote:
> > You can do a plain HTTP GET. The request parameters should have the same
> > names at the localNames in the schema. for eg if you use the following
> > request
> > http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > then there should be a element called john in the request according to its
> > schema.
> >
> > Thanks,
> > Keith.
> >
> >
> >  On 6/11/07, John G. Norman <jo...@7fff.com> wrote:
> > > Keith,
> > >
> > > Thanks.
> > >
> > > How do I do that with just a plain HTTP GET? Parameters on the URL?
> > >
> > > John
> > >
> > > On 6/11/07, keith chapman <ke...@gmail.com> wrote:
> > > > Hi John,
> > > >
> > > > Yes REST works for pojo services.
> > > > It looks like the request should ne namespace qualified. Just try
> > qualifying
> > > > the request usung the namespace
> > > > http://service.addressbook.sample/xsd .
> > > >
> > > > Thanks Keith.
> > > >
> > > >
> > > > On 6/8/07, John G. Norman <jo...@7fff.com> wrote:
> > > > >
> > > > > Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
> > > > > POJO service?
> > > > >
> > > > > The short version of my question is that I'm making a GET request like
> > > > this:
> > > > >
> > > > >
> > > >
> > http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > > > >
> > > > > But am getting an exception regarding a namespace mismatch
> > > > >
> > > > > Here's what I did to samples/pojo:
> > > > >
> > > > > 1. Have the default constructor to the sample/pojo AddressBookService
> > > > > add a couple of Entry. E.g.,
> > > > >
> > > > >   public AddressBookService() {
> > > > >     super();
> > > > >     Entry e1 = new Entry();
> > > > >     e1.setName("John");
> > > > >     e1.setStreet("1 Broadway");
> > > > >     e1.setCity("Cambridge");
> > > > >     e1.setState("MA");
> > > > >     e1.setPostalCode("02142");
> > > > >     Entry e2 = new Entry();
> > > > >     e2.setName("George");
> > > > >     e2.setStreet("1600 Penn");
> > > > >     e2.setCity("Washington");
> > > > >     e2.setState("DC");
> > > > >     e2.setPostalCode("01111");
> > > > >     entries.put(e1.getName(), e1);
> > > > >     entries.put (e2.getName(), e2);
> > > > >   }
> > > > >
> > > > > 2. Build and deploy.
> > > > >
> > > > > 3. Try and access the service as follows:
> > > > >
> > > > >
> > > >
> > http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > > > >
> > > > > 4. Get exception like this:
> > > > >
> > > > > Jun 8, 2007 1:56:30 PM
> > > > > org.apache.axis2.rpc.receivers.RPCMessageReceiver
> > > > invokeBusinessLogic
> > > > > SEVERE: Exception occurred while trying to invoke service method
> > findEntry
> > > > > org.apache.axis2.AxisFault: namespace mismatch require
> > > > > http://service.addressbook.sample/xsd found none
> > > > >     at
> > > >
> > org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
> > > > >     at
> > > >
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > > > (AbstractInOutSyncMessageReceiver.java:39)
> > > > >     at
> > > >
> > org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
> > > > >
> > > > > 5. I haven't added a JIRA -- seems like this one deserves a sanity
> > > > > check. Anyone?
> > > > >
> > > > > I found this in my own code where a service which worked via the 1.1.1
> > > > > Axis2RestServlet worked; but is now seemingly broken in the same way
> > > > > as the above.
> > > > >
> > > > > 6. As an aside, the documentation here:
> > > > >
> > > > >     http://ws.apache.org/axis2/1_2/rest-ws.html
> > > > >
> > > > > is quite thin. The very last section shows a regular GET accessing
> > > > > version information via
> > > > >
> > http://127.0.0.1:8080/axis2/services/Version/getVersion
> > > > -- that's
> > > > > perfectly nice, but showing a few more examples, e.g., accessing a
> > > > > service with parameters -- would be more realistic. To be sure, one
> > > > > might write a Java REST client, but I would hazard a guess that many
> > > > > users are clients are in scripting languages and they just want to hit
> > > > > the URL and get the XML representation back.
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Keith Chapman
> > > > WSO2 Inc.
> > > > Oxygen for Web Services Developers.
> > > > http://wso2.org/
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> >
> > --
> > Keith Chapman
> > WSO2 Inc.
> > Oxygen for Web Services Developers.
> > http://wso2.org/
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Does Axis2 1.2 REST work with POJO service?

Posted by "John G. Norman" <jo...@7fff.com>.
Keith,

That's what's apparently broken.

John

On 6/11/07, keith chapman <ke...@gmail.com> wrote:
> You can do a plain HTTP GET. The request parameters should have the same
> names at the localNames in the schema. for eg if you use the following
> request
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> then there should be a element called john in the request according to its
> schema.
>
> Thanks,
> Keith.
>
>
>  On 6/11/07, John G. Norman <jo...@7fff.com> wrote:
> > Keith,
> >
> > Thanks.
> >
> > How do I do that with just a plain HTTP GET? Parameters on the URL?
> >
> > John
> >
> > On 6/11/07, keith chapman <ke...@gmail.com> wrote:
> > > Hi John,
> > >
> > > Yes REST works for pojo services.
> > > It looks like the request should ne namespace qualified. Just try
> qualifying
> > > the request usung the namespace
> > > http://service.addressbook.sample/xsd .
> > >
> > > Thanks Keith.
> > >
> > >
> > > On 6/8/07, John G. Norman <jo...@7fff.com> wrote:
> > > >
> > > > Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
> > > > POJO service?
> > > >
> > > > The short version of my question is that I'm making a GET request like
> > > this:
> > > >
> > > >
> > >
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > > >
> > > > But am getting an exception regarding a namespace mismatch
> > > >
> > > > Here's what I did to samples/pojo:
> > > >
> > > > 1. Have the default constructor to the sample/pojo AddressBookService
> > > > add a couple of Entry. E.g.,
> > > >
> > > >   public AddressBookService() {
> > > >     super();
> > > >     Entry e1 = new Entry();
> > > >     e1.setName("John");
> > > >     e1.setStreet("1 Broadway");
> > > >     e1.setCity("Cambridge");
> > > >     e1.setState("MA");
> > > >     e1.setPostalCode("02142");
> > > >     Entry e2 = new Entry();
> > > >     e2.setName("George");
> > > >     e2.setStreet("1600 Penn");
> > > >     e2.setCity("Washington");
> > > >     e2.setState("DC");
> > > >     e2.setPostalCode("01111");
> > > >     entries.put(e1.getName(), e1);
> > > >     entries.put (e2.getName(), e2);
> > > >   }
> > > >
> > > > 2. Build and deploy.
> > > >
> > > > 3. Try and access the service as follows:
> > > >
> > > >
> > >
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > > >
> > > > 4. Get exception like this:
> > > >
> > > > Jun 8, 2007 1:56:30 PM
> > > > org.apache.axis2.rpc.receivers.RPCMessageReceiver
> > > invokeBusinessLogic
> > > > SEVERE: Exception occurred while trying to invoke service method
> findEntry
> > > > org.apache.axis2.AxisFault: namespace mismatch require
> > > > http://service.addressbook.sample/xsd found none
> > > >     at
> > >
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
> > > >     at
> > >
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > > (AbstractInOutSyncMessageReceiver.java:39)
> > > >     at
> > >
> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
> > > >
> > > > 5. I haven't added a JIRA -- seems like this one deserves a sanity
> > > > check. Anyone?
> > > >
> > > > I found this in my own code where a service which worked via the 1.1.1
> > > > Axis2RestServlet worked; but is now seemingly broken in the same way
> > > > as the above.
> > > >
> > > > 6. As an aside, the documentation here:
> > > >
> > > >     http://ws.apache.org/axis2/1_2/rest-ws.html
> > > >
> > > > is quite thin. The very last section shows a regular GET accessing
> > > > version information via
> > > >
> http://127.0.0.1:8080/axis2/services/Version/getVersion
> > > -- that's
> > > > perfectly nice, but showing a few more examples, e.g., accessing a
> > > > service with parameters -- would be more realistic. To be sure, one
> > > > might write a Java REST client, but I would hazard a guess that many
> > > > users are clients are in scripting languages and they just want to hit
> > > > the URL and get the XML representation back.
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Keith Chapman
> > > WSO2 Inc.
> > > Oxygen for Web Services Developers.
> > > http://wso2.org/
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
>
> --
> Keith Chapman
> WSO2 Inc.
> Oxygen for Web Services Developers.
> http://wso2.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Does Axis2 1.2 REST work with POJO service?

Posted by keith chapman <ke...@gmail.com>.
You can do a plain HTTP GET. The request parameters should have the same
names at the localNames in the schema. for eg if you use the following
request
http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
then there should be a element called john in the request according to its
schema.

Thanks,
Keith.

On 6/11/07, John G. Norman <jo...@7fff.com> wrote:
>
> Keith,
>
> Thanks.
>
> How do I do that with just a plain HTTP GET? Parameters on the URL?
>
> John
>
> On 6/11/07, keith chapman <ke...@gmail.com> wrote:
> > Hi John,
> >
> > Yes REST works for pojo services.
> > It looks like the request should ne namespace qualified. Just try
> qualifying
> > the request usung the namespace
> > http://service.addressbook.sample/xsd .
> >
> > Thanks Keith.
> >
> >
> > On 6/8/07, John G. Norman <jo...@7fff.com> wrote:
> > >
> > > Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
> > > POJO service?
> > >
> > > The short version of my question is that I'm making a GET request like
> > this:
> > >
> > >
> >
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > >
> > > But am getting an exception regarding a namespace mismatch
> > >
> > > Here's what I did to samples/pojo:
> > >
> > > 1. Have the default constructor to the sample/pojo AddressBookService
> > > add a couple of Entry. E.g.,
> > >
> > >   public AddressBookService() {
> > >     super();
> > >     Entry e1 = new Entry();
> > >     e1.setName("John");
> > >     e1.setStreet("1 Broadway");
> > >     e1.setCity("Cambridge");
> > >     e1.setState("MA");
> > >     e1.setPostalCode("02142");
> > >     Entry e2 = new Entry();
> > >     e2.setName("George");
> > >     e2.setStreet("1600 Penn");
> > >     e2.setCity("Washington");
> > >     e2.setState("DC");
> > >     e2.setPostalCode("01111");
> > >     entries.put(e1.getName(), e1);
> > >     entries.put(e2.getName(), e2);
> > >   }
> > >
> > > 2. Build and deploy.
> > >
> > > 3. Try and access the service as follows:
> > >
> > >
> >
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > >
> > > 4. Get exception like this:
> > >
> > > Jun 8, 2007 1:56:30 PM
> > > org.apache.axis2.rpc.receivers.RPCMessageReceiver
> > invokeBusinessLogic
> > > SEVERE: Exception occurred while trying to invoke service method
> findEntry
> > > org.apache.axis2.AxisFault: namespace mismatch require
> > > http://service.addressbook.sample/xsd found none
> > >     at
> > org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(
> RPCMessageReceiver.java:98)
> > >     at
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > (AbstractInOutSyncMessageReceiver.java:39)
> > >     at
> > org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
> > >
> > > 5. I haven't added a JIRA -- seems like this one deserves a sanity
> > > check. Anyone?
> > >
> > > I found this in my own code where a service which worked via the 1.1.1
> > > Axis2RestServlet worked; but is now seemingly broken in the same way
> > > as the above.
> > >
> > > 6. As an aside, the documentation here:
> > >
> > >     http://ws.apache.org/axis2/1_2/rest-ws.html
> > >
> > > is quite thin. The very last section shows a regular GET accessing
> > > version information via
> > > http://127.0.0.1:8080/axis2/services/Version/getVersion
> > -- that's
> > > perfectly nice, but showing a few more examples, e.g., accessing a
> > > service with parameters -- would be more realistic. To be sure, one
> > > might write a Java REST client, but I would hazard a guess that many
> > > users are clients are in scripting languages and they just want to hit
> > > the URL and get the XML representation back.
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> >
> > --
> > Keith Chapman
> > WSO2 Inc.
> > Oxygen for Web Services Developers.
> > http://wso2.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/

Re: Does Axis2 1.2 REST work with POJO service?

Posted by "John G. Norman" <jo...@7fff.com>.
Keith,

Thanks.

How do I do that with just a plain HTTP GET? Parameters on the URL?

John

On 6/11/07, keith chapman <ke...@gmail.com> wrote:
> Hi John,
>
> Yes REST works for pojo services.
> It looks like the request should ne namespace qualified. Just try qualifying
> the request usung the namespace
> http://service.addressbook.sample/xsd .
>
> Thanks Keith.
>
>
> On 6/8/07, John G. Norman <jo...@7fff.com> wrote:
> >
> > Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
> > POJO service?
> >
> > The short version of my question is that I'm making a GET request like
> this:
> >
> >
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> >
> > But am getting an exception regarding a namespace mismatch
> >
> > Here's what I did to samples/pojo:
> >
> > 1. Have the default constructor to the sample/pojo AddressBookService
> > add a couple of Entry. E.g.,
> >
> >   public AddressBookService() {
> >     super();
> >     Entry e1 = new Entry();
> >     e1.setName("John");
> >     e1.setStreet("1 Broadway");
> >     e1.setCity("Cambridge");
> >     e1.setState("MA");
> >     e1.setPostalCode("02142");
> >     Entry e2 = new Entry();
> >     e2.setName("George");
> >     e2.setStreet("1600 Penn");
> >     e2.setCity("Washington");
> >     e2.setState("DC");
> >     e2.setPostalCode("01111");
> >     entries.put(e1.getName(), e1);
> >     entries.put(e2.getName(), e2);
> >   }
> >
> > 2. Build and deploy.
> >
> > 3. Try and access the service as follows:
> >
> >
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> >
> > 4. Get exception like this:
> >
> > Jun 8, 2007 1:56:30 PM
> > org.apache.axis2.rpc.receivers.RPCMessageReceiver
> invokeBusinessLogic
> > SEVERE: Exception occurred while trying to invoke service method findEntry
> > org.apache.axis2.AxisFault: namespace mismatch require
> > http://service.addressbook.sample/xsd found none
> >     at
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
> >     at
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> (AbstractInOutSyncMessageReceiver.java:39)
> >     at
> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
> >
> > 5. I haven't added a JIRA -- seems like this one deserves a sanity
> > check. Anyone?
> >
> > I found this in my own code where a service which worked via the 1.1.1
> > Axis2RestServlet worked; but is now seemingly broken in the same way
> > as the above.
> >
> > 6. As an aside, the documentation here:
> >
> >     http://ws.apache.org/axis2/1_2/rest-ws.html
> >
> > is quite thin. The very last section shows a regular GET accessing
> > version information via
> > http://127.0.0.1:8080/axis2/services/Version/getVersion
> -- that's
> > perfectly nice, but showing a few more examples, e.g., accessing a
> > service with parameters -- would be more realistic. To be sure, one
> > might write a Java REST client, but I would hazard a guess that many
> > users are clients are in scripting languages and they just want to hit
> > the URL and get the XML representation back.
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
>
> --
> Keith Chapman
> WSO2 Inc.
> Oxygen for Web Services Developers.
> http://wso2.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Does Axis2 1.2 REST work with POJO service?

Posted by keith chapman <ke...@gmail.com>.
Hi John,

Yes REST works for pojo services.
It looks like the request should ne namespace qualified. Just try qualifying
the request usung the namespace http://service.addressbook.sample/xsd.

Thanks Keith.

On 6/8/07, John G. Norman <jo...@7fff.com> wrote:
>
> Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
> POJO service?
>
> The short version of my question is that I'm making a GET request like
> this:
>
>
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
>
> But am getting an exception regarding a namespace mismatch
>
> Here's what I did to samples/pojo:
>
> 1. Have the default constructor to the sample/pojo AddressBookService
> add a couple of Entry. E.g.,
>
>   public AddressBookService() {
>     super();
>     Entry e1 = new Entry();
>     e1.setName("John");
>     e1.setStreet("1 Broadway");
>     e1.setCity("Cambridge");
>     e1.setState("MA");
>     e1.setPostalCode("02142");
>     Entry e2 = new Entry();
>     e2.setName("George");
>     e2.setStreet("1600 Penn");
>     e2.setCity("Washington");
>     e2.setState("DC");
>     e2.setPostalCode("01111");
>     entries.put(e1.getName(), e1);
>     entries.put(e2.getName(), e2);
>   }
>
> 2. Build and deploy.
>
> 3. Try and access the service as follows:
>
>
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
>
> 4. Get exception like this:
>
> Jun 8, 2007 1:56:30 PM
> org.apache.axis2.rpc.receivers.RPCMessageReceiver invokeBusinessLogic
> SEVERE: Exception occurred while trying to invoke service method findEntry
> org.apache.axis2.AxisFault: namespace mismatch require
> http://service.addressbook.sample/xsd found none
>     at
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(
> RPCMessageReceiver.java:98)
>     at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> (AbstractInOutSyncMessageReceiver.java:39)
>     at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
>
> 5. I haven't added a JIRA -- seems like this one deserves a sanity
> check. Anyone?
>
> I found this in my own code where a service which worked via the 1.1.1
> Axis2RestServlet worked; but is now seemingly broken in the same way
> as the above.
>
> 6. As an aside, the documentation here:
>
>     http://ws.apache.org/axis2/1_2/rest-ws.html
>
> is quite thin. The very last section shows a regular GET accessing
> version information via
> http://127.0.0.1:8080/axis2/services/Version/getVersion -- that's
> perfectly nice, but showing a few more examples, e.g., accessing a
> service with parameters -- would be more realistic. To be sure, one
> might write a Java REST client, but I would hazard a guess that many
> users are clients are in scripting languages and they just want to hit
> the URL and get the XML representation back.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/