Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


VB.NET Soap Method Not Exposed


VB.NET Soap Method Not Exposed

Author
Message
mikek9999
mikek9999
Forum God
Forum God (387 reputation)Forum God (387 reputation)Forum God (387 reputation)Forum God (387 reputation)Forum God (387 reputation)Forum God (387 reputation)Forum God (387 reputation)Forum God (387 reputation)Forum God (387 reputation)

Group: Forum Members
Posts: 1, Visits: 1
I am writting a program that communicates with Amazon Seller services.  One of the tasks involved is the uploading and downloading of XML documents containting order information.  Below is the example source code provided by Amazon for vb.net.  I finally got most of the code working, but I am stuck on one issue.  A method is not exposed that should be.  The Attachments method is not available for the RequestSoapContext method.  I am at a loss as to why this might be the case.  Unfortunately the documentation and support from Amazon is pretty much nonexisting.  There was a post regarding this on the Amazon Developer Forum, but it did not fix my problem.  They post stated that the issue was with Web Services 2.0 not being installed correctly.  They suggested that I uninstall Web Services 2.0 and reinstall selecting the Developer option.  This didn't corrrect the problem.  Below is the sample code that I'm trying to get to work.  Any help or ideas in this would GREATLY be appreciated.  This is my first Soap project so I'm kinda at a loss as to what could be causing my problem of the Attachment method not getting exposed.
 
 WSDL=http://sellercentral.amazon.com/help/merchant_documents/WSDL/merchant-interface-dime-dotnet.wsdl

        Dim merchant As New com.amazon.sellercentral.Merchant
        merchant.merchantIdentifier = "<my merchant id>"
        merchant.merchantName = "<my merchant name>"

        Dim mi As New com.amazon.sellercentral.merchantinterfacedimeWse

        mi.Url = "http://merchant-api.amazon.com/gateway/merchant-interface-dime/"

        Dim networkCreds As New System.Net.NetworkCredential
        networkCreds.UserName = "<username>"
        networkCreds.Password = "<password>"

        mi.Credentials = networkCreds
        mi.PreAuthenticate = True

        Dim theAttachement As New DimeAttachment("text/xml", TypeFormat.MediaType, File.OpenRead("c:\mike.txt"))
        theAttachement.Id = Guid.NewGuid().ToString

        Dim theDoc As New com.amazon.sellercentral.ReferencedBinary
        theDoc.location = theAttachement.Id

        mi.RequestSoapContext.Attachments.Add(theAttachment)   <--- the attachment method is not exposed

        Dim theResponse As com.amazon.sellercentral.DocumentSubmissionResponse = mi.postDocument(merchant, "_POST_PRODUCT_DATA_", theDoc)

        MsgBox(theResponse.documentTransactionID)

Thanks,
Mike Kelley
mike@mikekelleyconsulting.com

michaelsowa
michaelsowa
Forum God
Forum God (379 reputation)Forum God (379 reputation)Forum God (379 reputation)Forum God (379 reputation)Forum God (379 reputation)Forum God (379 reputation)Forum God (379 reputation)Forum God (379 reputation)Forum God (379 reputation)

Group: Forum Members
Posts: 1, Visits: 2
Hi,



I have a very similar issue with the DIME interface using VB. I get the following error though:



No reference found in element, incorrect attachment reference [System.Web.Services.Protocols.SoapException]




My issues are different from yours though. When I added the web service to my project a ReferenceBinary class was not included so I had to create it manually. It works fine for retrieving documents, but gives the error above when posting documents. Here is my code:



Dim mi As Webthinking.wsAmazon.merchantinterfacedime = GetMerchantInterface(AmazonSite, SiteID)



'Load the file data into a stream

Dim ms As New MemoryStream

Dim enc As New System.Text.UTF8Encoding

Dim arrBytData() As Byte = enc.GetBytes(FileXML.OuterXml)

ms.Write(arrBytData, 0, arrBytData.Length)



'setup the attachment file

Dim theAttachment As New DimeAttachment("text/xml", TypeFormat.MediaType, ms)

theAttachment.Id = Guid.NewGuid().ToString



Call mi.RequestSoapContext.Attachments.Add(theAttachment)



'Add the attchemnt to the referenced binary variable

Dim theDoc As New Webthinking.wsAmazon.ReferencedBinary <--- THIS IS MY OWN CLASS

theDoc.Location = theAttachment.Id



Dim Resp As Webthinking.wsAmazon.DocumentSubmissionResponse = mi.postDocument(Merchant(AmazonSite, SiteID), "_POST_ORDER_FULFILLMENT_DATA_", theDoc)



The line above gives the error




Did you find a solution to your issue - if so can you post it on here? Also if you have a snipped of the referencedbinary class from your project that would help greatly.



Thanks



Mike




Hi,



I have a similar issue with the uploading of XML documents using DIME. I get the following error:



"No reference found in element, incorrect attachment reference [System.Web.Services.Protocols.SoapException] "



When I loaded the WSDL into my project and .NET created the service there was no RefrenceBinary class so I had to create that myself. SO thinking that may be the cause4. Anyway I was wondering if you managed to get your project top work and wondered if you wouldn't mind posting your solution?



Thanks



Mike
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search