Larry Brister
asked on
Invoke Web Service
I've been supplied by a vendor with url that when I go to it has a simple input box
I have test xml that I simply paste into that box
Click Invoke
And XML response is returned
I need example C# or VB code of how to accomplish that from a web form server side code.
I have test xml that I simply paste into that box
Click Invoke
And XML response is returned
I need example C# or VB code of how to accomplish that from a web form server side code.
It depends if the form the vendor gave you supports parameters. If it doesn't then there is nothing you can do. If it does, then let me know which parameter it is expecting.
ASKER
Randy...
This is the url (actual domain changed)
https://approvals.theirdomain.com/webservices/Wspaymentprocess/paymentprocess.asmx?op=ChargeRequestIntegration
This is the url (actual domain changed)
https://approvals.theirdomain.com/webservices/Wspaymentprocess/paymentprocess.asmx?op=ChargeRequestIntegration
This url times out.
ASKER
Randy...
That's not the actual domain
That's not the actual domain
ASKER
If I go to the url and invoke without any content I get this
<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://www.DOMAINREDACTED.com/"><?xml version="1.0" encoding="utf-8" ?><ChargeResponse xmlns="http://www.DOMAINREDACTED.com/"><Result>Error</Re sult><Comp anyId></Co mpanyId><C ustomerId> </Customer Id><LoanNu mber></Loa nNumber><R eferenceNo ></Referen ceNo><Appr ovalCode>< /ApprovalC ode><MsgDe scription> Modify header error: Invalid xml request format. </MsgDescription><RequestT ime></Requ estTime><R esponseTim e></Respon seTime></C hargeRespo nse></stri ng>
<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://www.DOMAINREDACTED.com/"><?xml version="1.0" encoding="utf-8" ?><ChargeResponse xmlns="http://www.DOMAINREDACTED.com/"><Result>Error</Re
so it is expecting you to send it the parameters as an XML or SOAP request. If going to the url doesn't tell you what it is expecting, then you will need to get that information from the people who created the site.
Quite often they can be exposed by navigating your browser to:
https://approvals.theirdomain.com/webservices/Wspaymentprocess/paymentprocess.asmx
and remove the op to get a list of functions and what they expect.
https://approvals.theirdomain.com/webservices/Wspaymentprocess/paymentprocess.asmx
and remove the op to get a list of functions and what they expect.
ASKER
Wait...
If I go to their url
And simply drop in the XML and invoke
That doesn't indicate its a XML Post?
If I go to their url
And simply drop in the XML and invoke
That doesn't indicate its a XML Post?
no it doesn't
You need to find out what kind of service this is. Is it SOAP or REST? The kind of service will dictate how you call it from code.
ASKER
I am using this...
And getting this exact (password etc changed for this post) response back...
using (var client = new raMakePaymentDev.PaymentProcessSoapClient("PaymentProcessSoap1"))
{
string s = client.CreditRequest(GetTextFromXMLFile(Server.MapPath("XMLFile.xml"))).ToString();
}
And getting this exact (password etc changed for this post) response back...
<?xml version="1.0" encoding="utf-8" ?><ChargeResponse xmlns="http://www.ramembers.com/"><Result>Error</Result><CompanyId></CompanyId><CustomerId></CustomerId><LoanNumber></LoanNumber><ReferenceNo></ReferenceNo><ApprovalCode></ApprovalCode><MsgDescription>Modify header error: Invalid xml request format. <?xml version="1.0" encoding="utf-8"?>
<ChargeRequest xmlns="http://www.ramembers.com/">
<UserName>sdptobwphbnpohp[</UserName>
<Password>sdpoifuhvpsediubvhsbwphbp</Password>
<CompanyId>TU</CompanyId>
<CustomerId>00171</CustomerId>
<PaymentType>141</PaymentType>
<CreditCardNumber>4111111111111111</CreditCardNumber>
<CVV2>325</CVV2>
<ExpirationMonth>07</ExpirationMonth>
<ExpirationYear>2020</ExpirationYear>
<Amount>2.00</Amount>
<CurrencyType>840</CurrencyType>
<FirstName>Billy</FirstName>
<MiddleName></MiddleName>
<LastName>Bates</LastName>
<HolderAddress>99999 SW 25TH Street</HolderAddress>
<HolderCity>Miami</HolderCity>
<HolderState>Florida</HolderState>
<HolderZipCode>33067</HolderZipCode>
<HolderCountry>USA</HolderCountry>
<Comments></Comments>
<UserCode>meterCode</UserCode>
<PointofSale>WEB</PointofSale>
</ChargeRequest></MsgDescription><RequestTime></RequestTime><ResponseTime></ResponseTime></ChargeResponse>
ASKER
Ok... is a soap service.
It looks like you've already got the code that will call the service. so what is the issue? The parameter list of CreditRequest should tell you what to pass.
ASKER
In thread ID: 41548930
If I take that same exact XML that it is showing has error...
And go directly to the Web Service URL...
And paste it in and invoke
It works and returns an "Approved" message
I cannot "get" why this is failing code side.
If I take that same exact XML that it is showing has error...
And go directly to the Web Service URL...
And paste it in and invoke
It works and returns an "Approved" message
I cannot "get" why this is failing code side.
What is the method signature of client.CreditRequest?
ASKER
kaufmed...
I recognized the vowels and consonants of your question.
How do I determine that?
I recognized the vowels and consonants of your question.
How do I determine that?
What are the parameters (and their types) and what is the return type?
ASKER
Kaufmed...
I truly am missing your question since I have limited background in this from the technical side
If the url is...(actual domain changed)
https://approvals.theirdomain.com/webservices/Wspaymentprocess/paymentprocess.asmx?op=ChargeRequestIntegration
And the XML is
<ChargeRequest xmlns="http://www.ramembers.com/">
<UserName>sdptobwphbnpohp[ </UserName >
<Password>sdpoifuhvpsediub vhsbwphbp< /Password>
<CompanyId>TU</CompanyId>
<CustomerId>00171</Custome rId>
<PaymentType>141</PaymentT ype>
<CreditCardNumber>41111111 11111111</ CreditCard Number>
<CVV2>325</CVV2>
<ExpirationMonth>07</Expir ationMonth >
<ExpirationYear>2020</Expi rationYear >
<Amount>2.00</Amount>
<CurrencyType>840</Currenc yType>
<FirstName>Billy</FirstNam e>
<MiddleName></MiddleName>
<LastName>Bates</LastName>
<HolderAddress>99999 SW 25TH Street</HolderAddress>
<HolderCity>Miami</HolderC ity>
<HolderState>Florida</Hold erState>
<HolderZipCode>33067</Hold erZipCode>
<HolderCountry>USA</Holder Country>
<Comments></Comments>
<UserCode>meterCode</UserC ode>
<PointofSale>WEB</PointofS ale>
</ChargeRequest>
What do you mean by Paramaters?
I truly am missing your question since I have limited background in this from the technical side
If the url is...(actual domain changed)
https://approvals.theirdomain.com/webservices/Wspaymentprocess/paymentprocess.asmx?op=ChargeRequestIntegration
And the XML is
<ChargeRequest xmlns="http://www.ramembers.com/">
<UserName>sdptobwphbnpohp[
<Password>sdpoifuhvpsediub
<CompanyId>TU</CompanyId>
<CustomerId>00171</Custome
<PaymentType>141</PaymentT
<CreditCardNumber>41111111
<CVV2>325</CVV2>
<ExpirationMonth>07</Expir
<ExpirationYear>2020</Expi
<Amount>2.00</Amount>
<CurrencyType>840</Currenc
<FirstName>Billy</FirstNam
<MiddleName></MiddleName>
<LastName>Bates</LastName>
<HolderAddress>99999 SW 25TH Street</HolderAddress>
<HolderCity>Miami</HolderC
<HolderState>Florida</Hold
<HolderZipCode>33067</Hold
<HolderCountry>USA</Holder
<Comments></Comments>
<UserCode>meterCode</UserC
<PointofSale>WEB</PointofS
</ChargeRequest>
What do you mean by Paramaters?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Kaufmed...
This is what I get with hover
string PaymentProcessSoapClient.C reditReque st(string creditrequest1)
This is what I get with hover
string PaymentProcessSoapClient.C
ASKER
You put me on the right track.
Turns out they had a typo in their documentation and it was actually another method.
When I did mouse-over and sent them screen print they "remembered" the changed code.
Turns out they had a typo in their documentation and it was actually another method.
When I did mouse-over and sent them screen print they "remembered" the changed code.