• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Axis webservice with a browser or c# client  RSS feed

 
Robin Lee ULS Tech Support
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Currently i am running axis 1.4 with tomcat 5.5.9..

At the moment, when using this web service through a java program interface (done through dynix, call VIP), this works great the way it is.

What i want to do is expose this to a .net (c#) program (or even just a normal browser as follows.

I figured out to getting to this part:
http://localhost/vip/services/BookInfoPort?method=GetBookInfoByISBN&isbn=9780312949631&customeraccount=test2&customersubaccount=test1&loginname=robin&loginpassword=test

Problem is that the data ends up in the wrong location...

2008-12-10 11:24:04,640 [INFO ] - ISBN: test
2008-12-10 11:24:04,640 [INFO ] - Converted ISBN: test
2008-12-10 11:24:04,640 [INFO ] - Check using ISBN:
2008-12-10 11:24:04,640 [INFO ] - Account: 9780312949631
2008-12-10 11:24:04,640 [INFO ] - SubAccount: test1
2008-12-10 11:24:04,640 [INFO ] - UserName: test2
2008-12-10 11:24:04,640 [INFO ] - Password: robin
2008-12-10 11:24:04,640 [INFO ] - Username NOT found
2008-12-10 11:24:04,640 [INFO ] - VIP: Invalid User or Wrong Password
2008-12-10 11:24:04,640 [INFO ] - User: test2
2008-12-10 11:24:04,640 [INFO ] - Password: robin
2008-12-10 11:24:04,640 [ERROR] - User: Invalid User or Wrong Password

Data doesn't end up where it is supposed to go to..

The order of the getBookInfoByISBN (String ISBN, String customerAccount,
String customerSubAccount, String loginName, String loginPassword).

All i'd like this to do is return an xml in the browser (as an external
program will be doing the same thing, and then parsing the info directly) so this is all i'd need it to do.

This service was set up by me, although i had an SDK and had help on
setting it all up. Since then, I am not able to get a hold of him, and need to change the way this service works without having to write a brand new version.

Anyone have any suggestions?

Thank you.

...Robin

Here is the WSDL

<wsdl efinitions targetNamespace="http://www.dynix.com/schema/book">

<wsdl:types>

<schema targetNamespace="GetBookInfoByISBN">

<complexType name="BookInfoType">

<sequence>
<element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="Author" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="ISBN" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="Publisher" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="PublicationDate" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="PublicationPlace" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="Edition" nillable="true" type="xsd:string"/>
<element name="DiscountPrice" type="xsd ouble"/>
<element maxOccurs="1" minOccurs="0" name="Availability" nillable="true" type="xsd:string"/>
<element name="ListPrice" type="xsd ouble"/>
<element name="DiscountPercent" type="xsd ouble"/>
</sequence>
</complexType>

<complexType name="BookInfoResponseType">

<sequence>
<element maxOccurs="1" minOccurs="0" name="Status" nillable="true" type="xsd:string"/>
<element name="BookInfo" nillable="true" type="tns1:BookInfoType"/>
<element maxOccurs="1" minOccurs="0" name="Marc" nillable="true" type="xsd:string"/>
</sequence>
</complexType>

<element name="GetBookInfoByISBN">

<complexType>

<sequence>
<element name="ISBN" type="xsd:string"/>
<element name="CustomerAccount" type="xsd:string"/>
<element name="CustomerSubAccount" type="xsd:string"/>
<element name="LoginName" type="xsd:string"/>
<element name="LoginPassword" type="xsd:string"/>
</sequence>
</complexType>
</element>

<element name="GetBookInfoByISBNResponse">

<complexType>

<sequence>
<element name="GetBookInfoByISBNResult" type="tns1:BookInfoResponseType"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>

<wsdl:message name="getBookInfoByISBNResponse">
<wsdl art element="tns1:GetBookInfoByISBNResponse" name="parameters"/>
</wsdl:message>

<wsdl:message name="getBookInfoByISBNRequest">
<wsdl art element="tns1:GetBookInfoByISBN" name="parameters"/>
</wsdl:message>

<wsdl ortType name="BookInfoPortType">

<wsdl peration name="getBookInfoByISBN" parameterOrder="">
<wsdl:input message="impl:getBookInfoByISBNRequest" name="getBookInfoByISBNRequest"/>
<wsdl utput message="impl:getBookInfoByISBNResponse" name="getBookInfoByISBNResponse"/>
</wsdl peration>
</wsdl ortType>

<wsdl:binding name="BookInfoPortSoapBinding" type="impl:BookInfoPortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl peration name="getBookInfoByISBN">
<wsdlsoap peration soapAction=""/>

<wsdl:input name="getBookInfoByISBNRequest">
<wsdlsoap:body namespace="GetBookInfoByISBN" use="literal"/>
</wsdl:input>

<wsdl utput name="getBookInfoByISBNResponse">
<wsdlsoap:body namespace="GetBookInfoByISBN" use="literal"/>
</wsdl utput>
</wsdl peration>
</wsdl:binding>

<wsdl:service name="BookInfoService">

<wsdl ort binding="impl:BookInfoPortSoapBinding" name="BookInfoPort">
<wsdlsoap:address location="http://localhost/vip/services/BookInfoPort"/>
</wsdl ort>
</wsdl:service>
</wsdl efinitions>
 
Robin Lee ULS Tech Support
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry, i didn't know about the smilies...

I'll requote the wsdl...
<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">

<wsdl:types>

<schema targetNamespace="GetBookInfoByISBN">

<complexType name="BookInfoType">

<sequence>
<element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="Author" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="ISBN" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="Publisher" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="PublicationDate" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="PublicationPlace" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="Edition" nillable="true" type="xsd:string"/>
<element name="DiscountPrice" type="xsd:double"/>
<element maxOccurs="1" minOccurs="0" name="Availability" nillable="true" type="xsd:string"/>
<element name="ListPrice" type="xsd:double"/>
<element name="DiscountPercent" type="xsd:double"/>
</sequence>
</complexType>

<complexType name="BookInfoResponseType">

<sequence>
<element maxOccurs="1" minOccurs="0" name="Status" nillable="true" type="xsd:string"/>
<element name="BookInfo" nillable="true" type="tns1:BookInfoType"/>
<element maxOccurs="1" minOccurs="0" name="Marc" nillable="true" type="xsd:string"/>
</sequence>
</complexType>

<element name="GetBookInfoByISBN">

<complexType>

<sequence>
<element name="ISBN" type="xsd:string"/>
<element name="CustomerAccount" type="xsd:string"/>
<element name="CustomerSubAccount" type="xsd:string"/>
<element name="LoginName" type="xsd:string"/>
<element name="LoginPassword" type="xsd:string"/>
</sequence>
</complexType>
</element>

<element name="GetBookInfoByISBNResponse">

<complexType>

<sequence>
<element name="GetBookInfoByISBNResult" type="tns1:BookInfoResponseType"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>

<wsdl:message name="getBookInfoByISBNResponse">
<wsdl:part element="tns1:GetBookInfoByISBNResponse" name="parameters"/>
</wsdl:message>

<wsdl:message name="getBookInfoByISBNRequest">
<wsdl:part element="tns1:GetBookInfoByISBN" name="parameters"/>
</wsdl:message>

<wsdl:portType name="BookInfoPortType">

<wsdlperation name="getBookInfoByISBN" parameterOrder="">
<wsdl:input message="impl:getBookInfoByISBNRequest" name="getBookInfoByISBNRequest"/>
<wsdlutput message="impl:getBookInfoByISBNResponse" name="getBookInfoByISBNResponse"/>
</wsdlperation>
</wsdl:portType>

<wsdl:binding name="BookInfoPortSoapBinding" type="impl:BookInfoPortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdlperation name="getBookInfoByISBN">
<wsdlsoapperation soapAction=""/>

<wsdl:input name="getBookInfoByISBNRequest">
<wsdlsoap:body namespace="GetBookInfoByISBN" use="literal"/>
</wsdl:input>

<wsdlutput name="getBookInfoByISBNResponse">
<wsdlsoap:body namespace="GetBookInfoByISBN" use="literal"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>

<wsdl:service name="BookInfoService">

<wsdl:port binding="impl:BookInfoPortSoapBinding" name="BookInfoPort">
<wsdlsoap:address location="http://localhost/vip/services/BookInfoPort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not quite what you're asking. It sounds like you want to access an Axis SOAP service through a browser; in other words purely through an URL instead of SOAP. Is that correct?

If so, then it's not going to work. Axis expects a SOAP request, not an HTTP GET request w/o a body. If that's what you're after, check out RESTful services as implemented by JAX-RS and Jersey.
 
Robin Lee ULS Tech Support
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
I'm not quite what you're asking. It sounds like you want to access an Axis SOAP service through a browser; in other words purely through an URL instead of SOAP. Is that correct?

That is correct.
Originally posted by Ulf Dittmer:
If so, then it's not going to work. Axis expects a SOAP request, not an HTTP GET request w/o a body. If that's what you're after, check out RESTful services as implemented by JAX-RS and Jersey.


That's too bad that it won't work that way.

The problem is that i have the service already working in the current environment and i don't want to change it. I also want to make a "copy" of this environment, without having to actually copy it for use with .net.

I figured it did work in someway else the data wouldn't have even shown up when i did my tests with it.

How does JAX-RS and Jersey work? Would i be able to implement that easily without doing too much to the current implementation?

Thanks again for replying...
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Considering that you have the service's WSDL description, the easiest way might be to use Axis' wsdl2java tool. It creates Java classes that be used to access the service in question.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Robin Lee ULS Tech Support:
I also want to make a "copy" of this environment, without having to actually copy it for use with .net.


What makes you think that you have to change anything? The WSDL shows that the web service uses the document/literal messaging mode - which is good news from an interoperability standpoint. Now the question is which .NET framework version (1.1, 2.0, 3.0, 3.5) the client is using as over time the capabilities of the various client proxy generating tools have changed.

wsdl.exe
svcutil.exe

So it really comes down to just trying it.
 
Robin Lee ULS Tech Support
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Peer Reynders:


What makes you think that you have to change anything? The WSDL shows that the web service uses the document/literal messaging mode - which is good news from an interoperability standpoint. Now the question is which .NET framework version (1.1, 2.0, 3.0, 3.5) the client is using as over time the capabilities of the various client proxy generating tools have changed.

wsdl.exe
svcutil.exe

So it really comes down to just trying it.

The big thing is that, the background code is written in java... change would only come if i have any changes to the way it works..

I don't know the .net framework, but i'm going to guess at least 3 or 3.5 as the user has already been set up to use a .net web service.

I don't understand what you mean by just trying it?

I'm very new to web services (although i know what it does), i just don't have any real formal training on it... at least not yet anyway.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!