Jump to content

Web service little problem


motabik

Recommended Posts

Hi

I have little problem with webservice

I link my excel with webservice and I try add new manufacturer
My program send information to web service , and a get answer 201 Created.

But in shop this manufacturer don't added.

Please help

Here is my code

sURL = "http://xxx/api/manufacturers/"
    sEnv = "<?xml version=""1.0"" encoding=""utf-8""?>"
   sEnv = sEnv & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
    sEnv = sEnv & "  <soap:Body>"
     
 sEnv = sEnv & "<prestashop xmlns:xlink=""http://www.w3.org/1999/xlink"">"
sEnv = sEnv & "<manufacturer><id>2</id><active>1</active><link_rewrite not_filterable=""true"">fashion-manufacturer</link_rewrite>"
sEnv = sEnv & "<name>Fashion Manufacturer_new</name><date_add></date_add><date_upd></date_upd><description><language id=""1"" xlink:href=""http://XXXXXX/api/languages/1""></language></description><short_description><language id=""1"" xlink:href=""http://XXXXXX/api/languages/1""></language></short_description><meta_title>"
sEnv = sEnv & "<language id=""1"" xlink:href=""http://XXXXXX/api/languages/1""></language></meta_title><meta_description><language id=""1"" xlink:href=""http://XXXXXX/api/languages/1""></language></meta_description><meta_keywords><language id=""1"" xlink:href=""http://XXXXXX/api/languages/1""></language></meta_keywords><associations><addresses node_type=""addresses""><addresses xlink:href=""http://XXXXXX/api/addresses/3""><id xlink:href=""http://XXXXXX/api/addresses/3"">3</id></addresses></addresses></associations></manufacturer></prestashop>"
   sEnv = sEnv & "  </soap:Body>"
    sEnv = sEnv & "</soap:Envelope>"
    Cells(1, 1) = sEnv
 
    With xmlhtp
        .Open "post", sURL, False, "XXXXXXXX"
        .setRequestHeader "Host", "XXXXX"
        .setRequestHeader "Content-Type", "text/xml; charset=utf-8"
        .setRequestHeader "soapAction", "http://xxxxxx@xxxx/api/manufacturers/"
        .setRequestHeader "Accept-encoding", "zip"
        .setRequestHeader "user", "xxxxxxx"
        .send (sEnv)
         
        
        
        MsgBox .Status & .statusText
         .abort
      
        
        
    End With

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...