Dim Briggs As New Z_SCART_CREATE_SALES_ORDER
Dim P1 As New Briggs_N_Stratton.Zvscartordhdrin
Dim P2 As New Briggs_N_Stratton.Zvscartorditmin
Dim P2arr(1) As Briggs_N_Stratton.Zvscartorditmin
Dim P3 As New Briggs_N_Stratton.Zvscartorditmout
Dim P3Arr(1) As Briggs_N_Stratton.Zvscartorditmout
Dim P4 As New Briggs_N_Stratton.Zvscartordtxt
Dim P4ARR(1) As Briggs_N_Stratton.Zvscartordtxt
Dim p5 As New Briggs_N_Stratton.Zvscartordmsgs
Dim p5Arr(1) As Briggs_N_Stratton.Zvscartordmsgs
Dim P6 As New Briggs_N_Stratton.Zvscartordpar
Dim P6arr(1) As Briggs_N_Stratton.Zvscartordpar
Dim SO As New Briggs_N_Stratton.ZScartCreateSalesOrder01
Briggs.Credentials = New System.Net.NetworkCredential("NXTUSER", "Password")
SO.Action = "B"
SO.Sender = "ARITPP"
''OrderHeaderIN''
P1.Ordtype = P(1, 1)
P1.Salesorg = P(1, 2)
P1.Distrch = P(1, 3)
P1.Divis = P(1, 4)
P1.Ordcatg = P(1, 5)
P1.Custpo = P(1, 6)
P1.Custpotype = P(1, 7)
P1.Custporef = P(1, 8)
P1.Delvprio = P(1, 9)
SO.OrderHeaderIn = P1
''OrderItemsIN
P2.Itmnum = P(2, 1)
P2.Matnumin = P(2, 2)
P2.Qty = P(2, 3)
P2.Delvdate = P(2, 4)
P2arr(0) = P2
SO.OrderItemsIn = P2arr
'OrderitemsOut
P3.Itmnum = P(3, 1)
P3.Matnumin = P(3, 2)
P3.Qty = P(3, 3)
P3.Delvdate = P(3, 4)
P3.Matnumout = P(3, 5)
P3.Description = P(3, 6)
P3.Itmlistprice = P(3, 7)
P3.Itmnetval = P(3, 8)
P3.Itmtax = P(3, 9)
P3.Itmtotal = P(3, 10)
P3Arr(0) = P3
SO.OrderItemsOut = P3Arr
''OrderLtext
P4.Textid = P(4, 1)
P4.Langu = P(4, 2)
P4.Textline = P(4, 3)
P4.Textline = P(4, 4)
P4ARR(0) = P4
SO.OrderLtext = P4ARR
''ordermessage
p5.Msgsrc = P(5, 1)
p5.Msgtype = P(5, 2)
p5.Msgid = P(5, 3)
p5.Msgnum = P(5, 4)
p5.Msgtext = P(5, 5)
p5Arr(0) = p5
SO.OrderMessages = p5Arr
''Order Partners
'PT 1
P6.Custrole = P(6, 1)
P6.Custnum = P(6, 2)
P6.Name1 = P(6, 3)
P6.Street = P(6, 4)
P6.Addr2 = P(6, 5)
P6.City = P(6, 6)
P6.Region = P(6, 7)
P6.Zipcode = P(6, 8)
P6.Country = P(6, 9)
P6.Emailadr = P(6, 10)
P6.Telnumber = P(6, 11)
P6.Faxnumber = P(6, 12)
'PT2
P6.Custrole = P(7, 1)
P6.Custnum = P(7, 2)
P6.Name1 = P(7, 3)
P6.Street = P(7, 4)
P6.Addr2 = P(7, 5)
P6.City = P(7, 6)
P6.Region = P(7, 7)
P6.Zipcode = P(7, 8)
P6.Country = P(7, 9)
P6.Emailadr = P(7, 10)
P6.Telnumber = P(7, 11)
P6.Faxnumber = P(7, 12)
'Pt3
P6.Custrole = P(8, 1)
P6.Custnum = P(8, 2)
P6.Name1 = P(8, 3)
P6.Street = P(8, 4)
P6.Addr2 = P(8, 5)
P6.City = P(8, 6)
P6.Region = P(8, 7)
P6.Zipcode = P(8, 8)
P6.Country = P(8, 9)
P6.Emailadr = P(8, 10)
P6.Telnumber = P(8, 11)
P6.Faxnumber = P(8, 12)
'Pt4
P6.Custrole = P(9, 1)
P6.Custnum = P(9, 2)
P6.Name1 = P(9, 3)
P6.Street = P(9, 4)
P6.Addr2 = P(9, 5)
P6.City = P(9, 6)
P6.Region = P(9, 7)
P6.Zipcode = P(9, 8)
P6.Country = P(9, 9)
P6.Emailadr = P(9, 10)
P6.Telnumber = P(9, 11)
P6.Faxnumber = P(9, 12)
P6arr(0) = P6
SO.OrderPartners = P6arr
Dim res As Briggs_N_Stratton.ZScartCreateSalesOrder01Response = Briggs.ZScartCreateSalesOrder01(SO)
Return res
I've created this above code for a WSDL, that accepts values and then gives a responce back. The code it self throws no errors but when it goes to use the function:
Public Function ZScartCreateSalesOrder01(<System.Xml.Serialization.XmlElementAttribute("ZScartCreateSalesOrder01", [Namespace]:="urn:sap-com:document:sap:soap:functions:mc-style")> ByVal ZScartCreateSalesOrder011 As ZScartCreateSalesOrder01) As <System.Xml.Serialization.XmlElementAttribute("ZScartCreateSalesOrder01Response", [Namespace]:="urn:sap-com:document:sap:soap:functions:mc-style")> ZScartCreateSalesOrder01Response
Dim results() As Object = Me.Invoke("ZScartCreateSalesOrder01", New Object() {ZScartCreateSalesOrder011})
Return CType(results(0), ZScartCreateSalesOrder01Response)
End Function
It throws the following error:
An Unhandled exception of type 'system.net.webExceptions' occurend in system.dll
Additional information: The underlying connection was closed: Unabled to connect to the remote server.
I've read up that it could be a firewall / proxy issue and I've even seen fixes for Asp.net such as: http://geekswithblogs.net/ranganh/archive/2005/08/29/51474.aspx
But I can't figure out how to get them to work with VB .Net 2003..
Any Ideas?
**For testing purpose the correct password is in place.
Thanks in advance!