473,382 Members | 1,261 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Consume PHP Soap web services using the .net Web Reference/proxy

I am coding in a visual studio 2008 (vb.net) web application & I am trying to access a clients php soap services through the .net web service proxy.

In an existing .net web project I have added a web Reference to the clients php soap service named articleService at the following location http://teamie.webcat3.web-catalogue.eu/service/webcat/articleService

Everything appears to be fine. I can view the articleService in the object browser.

The first thing I need to do is add header username & password authentication,

I have coded the following so far:
Expand|Select|Wrap|Line Numbers
  1. Dim articleService3 As articleService.ArticleServiceService = New articleService.ArticleServiceService()
  2.  Dim myCredentials As New System.Net.CredentialCache
  3. Dim myNetCred As New NetworkCredential("****", "****")
  4. myCredentials.Add(New Uri("http://teamie.webcat3.web-catalogue.eu/service/webcat/articleService"), "Basic", myNetCred)
  5.  'articleService3.UseDefaultCredentials = False ???
  6.  articleService3.PreAuthenticate = True
  7. articleService3.Credentials = myCredentials
I am unsure as to whether this is working or not because I have not been able to actually add the data I need using the articleService Function createOwnArticle

What I need to do is add an article via the articleService function createOwnArticle
Parameter of CreateOwnArticleRequest
This returns
CreateOwnArticleResponse

If you view the wsdl file in a browser you can see the definitions below:

<definitions name="ArticleService" targetNamespace="urn:ArticleServicewsdl"><wsdl:typ es><xsd:schema targetNamespace="urn:ArticleServicewsdl"><xsd:comp lexType name="CreateOwnArticleRequest"><xsd:all><xsd:eleme nt name="article" type="tns:NewOwnArticle"/></xsd:all></xsd:complexType><xsd:complexType name="NewOwnArticle"><xsd:all><xsd:element minOccurs="0" maxOccurs="1" nillable="true" name="id" type="xsd:integer"/><xsd:element name="tecdocArticleId" type="xsd:integer"/><xsd:element name="description" type="xsd:string"/><xsd:element name="notes" type="xsd:string"/><xsd:element name="articleNumber" type="xsd:string"/><xsd:element name="dealerId" type="xsd:integer"/></xsd:all></xsd:complexType><xsd:complexType name="CreateOwnArticleResponse"><xsd:all><xsd:elem ent minOccurs="0" maxOccurs="1" nillable="false" name="article" type="tns:ExistingOwnArticle"/><xsd:element name="errors" type="tns:ErrorArray"/></xsd:all></xsd:complexType><xsd:complexType name="ExistingOwnArticle"><xsd:all><xsd:element name="tecdocArticleId" type="xsd:integer"/><xsd:element name="description" type="xsd:string"/><xsd:element name="notes" type="xsd:string"/><xsd:element name="id" type="xsd:integer"/><xsd:element name="articleNumber" type="xsd:string"/><xsd:element name="dealerId" type="xsd:integer"/></xsd:all></xsd:complexType>

Or you can view the added webservice objects in the .net object browser.

The big issue is I don’t actually know how to pass the data I need into articleService function createOwnArticle

If this was consuming a .net webservice it would be as easy as the code below however that is the code below is returning error “Value of type Integer cannot be converted to TecDoc.articleService.CreateOwnArticleRequest”
Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim artId As Integer = 9
  3. Dim tecdocArticleId as integer = 1
  4. Dim artDesc As String = ""
  5. Dim artNotes As String = "Notes for text article 9"
  6. Dim artNumber As String = "TEST0009"
  7. Dim dealerID As Integer = 9
  8. Dim node As Xml.XmlNode        
  9. node = articleService3.createOwnArticle(artId, tecdocArticleId, artDesc, artNotes, artNumber, dealerID)
  10.  
The xml created when trying to do this via soapUI software is as follows:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ArticleServicewsdl">
<soapenv:Header/>
<soapenv:Body>
<urn:createOwnArticle soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<request xsi:type="urn:CreateOwnArticleRequest" xs:type="type:CreateOwnArticleRequest" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">
<article xsi:type="urn:NewOwnArticle" xn:type="urn:ArticleServicewsdl" xmlns:xn="http://www.w3.org/2000/xmlns/">
<!--You may enter the following 6 items in any order-->
<!--Optional:-->
<id xsi:type="xsd:integer" xs:type="type:integer">7</id>
<tecdocArticleId xsi:type="xsd:integer" xs:type="type:integer">1</tecdocArticleId>
<description xsi:type="xsd:string" xs:type="type:string">Test Article Desc 7</description>
<notes xsi:type="xsd:string" xs:type="type:string">Test Notes 7</notes>
<articleNumber xsi:type="xsd:string" xs:type="type:string">TEST0007</articleNumber>
<dealerId xsi:type="xsd:integer" xs:type="type:integer">1</dealerId>
</article>
</request>
</urn:createOwnArticle>
</soapenv:Body>
</soapenv:Envelope>

It’s like a need to declare some type of object for CreateOwnArticleResponse & populate it with data but I’ve no idea how to do this.
Other relevant information
The content of the actual HTTP header sent to the clients server (as generated by SOAP UI software):

POST
http://teamie.webcat3.web-catalogue.eu/en/service/webcat/articleService?ws=1
HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:ArticleServicewsdl#getOwnArticleList"
Content-Length: 1458
Host: teamie.webcat3.web-catalogue.eu
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Cookie: WEBCAT4_TEAMIE=7991b6a06cf71cd73bced1620aad50ef
Cookie2: $Version=1
Authorization: Basic dGVhbWllQHRlYW1pZS5jb206QTFkOTNUMU4=


I am Under huge pressure to get this working, testing was required last week & I can't even get the first web service function working! Please Help!!!!
Dec 3 '13 #1
0 1372

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: A.M-SG | last post by:
Hi, Can I view/modify SOAP message at the client proxy side without using soap extensions? Thank you,
5
by: David Lozzi | last post by:
Howdy, I wrote a web service in .Net for my customer. My customer has another vendor who now has to consume it but they are not using Visual Studio. Most of their pages are jsp, and they said...
2
by: chris | last post by:
Hi, I am trying to upload files on FTP and used the code below: Dim request As FtpWebRequest request = WebRequest.Create("ftp://ftp...../test.txt") request.Method =...
1
by: DoctorV3774 | last post by:
We developed a small test database that we are using to attempt to connect to a wsdl to consume web services. The database form contains 3 fields and a submit button on the form. At the bottom I've...
0
by: Maxx57 | last post by:
C# VS.Net 1.1 (2003) - trouble with using IE proxy server settings I've got a program that detects if it can connect to a webservice. It sends a System.Net.WebRequest and then checks the...
1
by: =?Utf-8?B?Z2FsbGFu?= | last post by:
We have an application that is running fine on several of our customer’s servers. However, one of our customers is having a problem running the application. The application works on one of his...
0
by: Nithi Gurusamy | last post by:
I have generated a Web-Service-Proxy (Add Web Reference) within VS. This proxy class is based on WebServicesClientProtocol of WSE 3.0. I want to add some custom HTTP Headers to the envelop before...
1
by: karthikpallavi | last post by:
Hi Everyone, I am battling an issue and I figured one of you guys on this forum may be able to help. I have a developed an application in java to access Microsoft Dynamics 10.0 through Web...
5
Gyanchand
by: Gyanchand | last post by:
I have a .Net API (wsdl). I have created a proxy for it, and now it want to use it in ASP. Since, we didn’t get any readymade Proxy generator for ASP/vbscript, We used .Net command prompt to generate...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.