-
2 Attachment(s)
using web service
hi
i am interacting with another package using webservice.
now the 3rd party who has developed the package has given me a link for the webservice.
Code:
http://??.??.??.??:8080/ABMPDA/services/PDA?wsdl
the above is the link to the web service. ?? being the nos.
now i have added this web service to my package.
i am developing the software on a PDA to use this webservice to get and update data to their package.
i have declared the webservice as
Code:
Dim AbmService As New WebReference.PDA
and set the url as under:
Code:
AbmService.Url = "http://??.??.??.??:8080/ABMPDA/services/PDA?wsdl"
they had send me the instructions as under:
Code:
Response of 1st isAuthenticate(java.lang.String,java.lang.String) method are-
a. Two input parameter (Tax collector officer login name and password defined in MAInet).
a. If user is valid user then o/p will be:-
Valid User^71 (Note- ‘^’ indicate separator, contain two parameters i.e. Valid User, 71)
b. If user is invalid user then o/p will be:-
Invalid User
i am calling the method as :
Code:
Dim mRetStr As String = AbmService.isAuthenticate(TxtUserName.Text, TxtPassword.Text)
it is not letting me to pass the parameter it is giving me an error
i have attached 2 images to explain how i have done.
in the first image i have just placed the dim abmservice statement down but actually it is before it.
they r saying we have explained u everthing and u need to change the way to call the webmethod.
can someone pls. guide me how i go around i am not getting any further help from there side.
pls. help me out as i have to show the demo at the earliest.
-
Re: using web service
Try using Internet Explorer to reach the WebService. IE will show the correct parameters of each method, if it shows that the parameters are not strings then take a screen shot of that and send it to the authors of the WebService.
-
Re: using web service
thankx for ur prompt reply. i typed the url in ie and got the following
Code:
- <xs:schema xmlns:ns="http://abm/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://abm/xsd">
- <xs:element name="encrypt">
- <xs:complexType>
- <xs:sequence>
<xs:element name="login_name" nillable="true" type="xs:string" />
<xs:element name="password" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
it is showing me that there r 2 parameters but i am confused as how else can i call it as that firm is telling me to change my coding and call it properly. i dont know of any other way to call it. i asked them too to show me the coding for calling it but they r not informing me.
-
Re: using web service
I think you didn't reference the web service correctly.
Suppose the url of the webservice you will consume is
Code:
http://www.domainname.com/service1
The steps to add a web reference differs from your VS version.
VS2005: Click on "Project" menu then "Add Web Reference...". Type in the url and click "Go". Select the web service(s) that is (are) avaible from that url and click "Add reference".
VS2008: Project menu > Add Service Reference. Then click on "Advanced..." button. Then click on "Add Web Reference..." button. Type in the url then click Go. Then select the webservice(s) that you want to consume and click "Add Reference".
Now back in your code, when you declare a variable for the web service, it will be in the form backwards to the url of the webservice. Taken the example url above, it will be like this
Code:
Dim myWebService as New service1.com.domainname.www
Intellisense will help you for the most part.
-
Re: using web service
thankx for ur help stanav but i have added the reference correctly. the webreference is updating correctly too when i press update web reference following is how i have declared it
Code:
Dim AbmService As New WebReference.PDA
-
Re: using web service
anyone to pls. help me out with this pls. am still stuck with it.
-
Re: using web service
Dim mRetStr As TaxCollection.WebReference.isAuthenticatedResponse = AbmService.isAuthenticate(TxtUserName.Text, TxtPassword.Text)
-
1 Attachment(s)
Re: using web service
even this is giving the same error as in post no. 1 attached is a snapshot of the error. i am really stuck with this one.
-
Re: using web service
Try this and see if it works...
Code:
Dim auth as New WebReference.isAuthenticate(userName, password) '<<< You will have to rely on Intellisense to see how
'to properly instantiate this object. The code shown is just a guessing/mock-up code.
Dim response as taxcollection.webreference.isauthenticateResponse = umcService.isAuthenticate(auth)
-
Re: using web service
it gives an error
Too Many arguments to 'Public Sub New()'
-
Re: using web service
Like stanav said, you have to use intellisense to work out which parameters are required! Their might be 2 objects you pass in, but they may only be properties.
So
Dim auth as New WebReference.isAuthenticate(xx) ' What goes here, we cant tell!
auth.login_name = "fdgdfkj" 'Again a guess, your going to have to intellisense it for us!
It seems daft to create a function as the same name as a type however.
-
Re: using web service
It seems that the wsdl file is incorrect. In the Solution Explorer click on the Show All Files button and under the Web Reference node find the .wsdl file and manually edit it to accept 2 strings for the isAuthenticate method.