Westwind Proxy Generator

General Discussion Forum - Voice The Sound In Your Head
Post Reply
VictorLawrence
Posts: 23
Joined: Fri Jul 14, 2023 11:45 pm

Fri Apr 12, 2024 6:52 am

Hello: I'm trying the Proxy Generator program cause the WebConnection program that bought long time ago didn't work with this webservice.
Created the proxy program from the WSDL file and did the following code:

Code: Select all

** Load the Proxy and Support Class Libraries
DO EdifileTransferProxy

*** Create an instance of the Proxy
LOCAL loProxy as EdiFileTransferProxy
loProxy = CREATEOBJECT("EdiFileTransferProxy","V4")
***loProxy.oService.IgnoreCertificateErrors()

LOCAL loBridge as wwDotNetBridge
loBridge = loProxy.oBridge

LOCAL loService as EdiFileTransfer.EdiFileTransfer
loService = loProxy.oService
loBridge.SetProperty(loService,"Url",lcUrl)

loProxy.oService.HttpLogin(lcUsername, lcPassword,.F.)

lcRequest = loProxy.SendX12File(LcFile, lcFileBody, lcFileDate, lcFixX12Envelope)				
IF loProxy.LERROR
	? loProxy.cErrorMsg  
	RETURN
ENDIF
The description of the service specifies a different URL which is not the same as the WSLD file URL and have an authenticationheader inside the SOAP.

The generated program section for this SendX12File request is:

Code: Select all

FUNCTION SendX12File(FileName as String,Body as String,FileDate as String,FixX12Envelope as Boolean) as FileTransferResult
LOCAL loException as Exception, lvResult as FileTransferResult

THIS.lError = .F.
this.cErrorMsg = ""
lvResult = .F.
TRY	
	lvResult = this.oBridge.InvokeMethod(this.oService, "SendX12File", FileName,Body,FileDate,FixX12Envelope)
	
CATCH to loException
	THIS.GetErrorDetail(loException)
ENDTRY

RETURN lvResult
ENDFUNC
*   SendX12File
What I don't see here is the reference to the new URL nor the AuthenticationHeader specified in the WSDL which is something like this (Have to change the website real addresses due to confidentiality agreement):

Code: Select all

POST /webservices/editransfer/edifiletransfer.asmx HTTP/1.1
Host: www.server.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length:
length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<AuthenticationHeader lmlns="https://www.server.com/ws/EdiFileTransfer/">
<Username>string</Username>
<Password>string</Password>
</AuthenticationHeader>
</soap12:Header>
<soap12:Body> 
<SendX12File xmlns="https://www.server.com/ws/EdiFileTransfer/">
<FileName>string</FileName>
<Body>string</Body>
<FileDate>string</FileDate>
<FixX12Envelope>boolean</FixX12Envelope>
</SendX12File>
</soap12:Body>
</soap12:Envelope>
Was wondering if these kind of webservers can we dealt with this tool? and if so how. I tried the code with the WSDL url and the error is "Server was unable to process request ---> Object reference not set to an instance of an object". If I use the other soapaction url get what looks like a webpage saying "object moved to errorpage" like if that page doesn't exist. Tried many things like using Bridge for the Authentication Header but that didn't work either. Sorry for the long post if its not the right tool for the job please let me know which tool should be using then or if I get this working will buy the tool immediately. Thanks!

User avatar
ModestoGarr
Posts: 18
Joined: Sat Apr 08, 2023 1:53 am

Fri Apr 12, 2024 9:13 am

It looks like you're working with the Westwind Proxy Generator to create a proxy program from a WSDL file. If you're encountering issues with the WebConnection program and need to use a different approach, the Proxy Generator can be a helpful tool.
When creating the proxy program, make sure to pay attention to the service's URL and any authentication requirements specified in the SOAP.
If you're looking for reliable proxies for your web connection needs, you might consider checking out Buy proxy. They offer a range of proxy options that could help with your project.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests